몇 시간 동안 검색했지만 귀하의 요구 사항에 따라 아무것도 찾을 수 없습니다. 그러나 일부 트라이크가 있거나 귀하의 요구 사항에 따라 출력을 얻을 수있는 해킹 코드가 있습니다.
아래와 같이 xml 파일에 RecyclerView을 설정하십시오. REVERS이 List 또는 ArrayList에 위해 우리가 ASEC 순서로 다음 우리의 데이터가 될 것입니다 우리가 회전 할 때 그래서 recyclerviews를 회전 디스플레이를 필요로하기 때문에
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbarAlwaysDrawHorizontalTrack="true"
android:scrollbarSize="10dp"
android:scrollbarStyle="outsideInset"
android:scrollbarThumbVertical="@color/black"
android:scrollbars="horizontal"
android:verticalScrollbarPosition="right"/>
은 데이터를 넣습니다.
//call this method for set recyclerview
private void setRecyclerView()
{
//Please make sure with your item that it will be inserted in revers order then an then it will be working
ArrayList<String> itemList = new ArrayList<>();
for (int i = 50; i > 0; i--){
itemList.add("item " + i);
}
ContainerAdapter adapterMessage = new ContainerAdapter(MainActivity.this, itemList);
if (adapterMessage != null)
{
rvItemList.setHasFixedSize(true);
rvItemList.setLayoutManager(new LinearLayoutManager(MainActivity.this,
LinearLayoutManager.HORIZONTAL, false);
rvItemList.setItemAnimator(new DefaultItemAnimator());
rvItemList.setAdapter(adapterMessage);
//here is the main line for your requirement
rvItemList.setRotation(180);
adapterMessage.notifyDataSetChanged();
}
이제 어댑터에서 모든보기를 아래와 같이 반대 방향으로 회전하십시오.
public class ViewHolder extends RecyclerView.ViewHolder
{
TextView txt_name;
public ViewHolder(View itemView) {
super(itemView);
txt_name = (TextView) itemView.findViewById(R.id.txt_name);
// here you need to revers rotate your view because your recyclerview is already rotate it so your view is also rotated and you need to revers rotate that view
txt_name.setRotation(-180);
}
}
그런 다음 위와 같이 코드를 할 경우 항목과 출력이 OutPut
과 같이 코드의이 종류의 일에 확인하시기 바랍니다 때문에 안드로이드 것이다 이러한 종류의 코드에 대한 책임,하지만 당 귀하의 요구 사항은 이와 같이 할 수 있습니다.
https://imgur.com/a/3WI9v 화면에 스크롤바가 표시됩니다. 네가 이렇게하면 핑 소리 내고 싶어. – Shailesh