[英]How to detect change in orientation of android phone from horizontal position to vertical position?
[英]how to change scroll vertical to horizontal when orientation change?
當設備方向更改為橫向時,我想將我的回收器滾動視圖垂直更改為水平...
這是我的 recyclerView 滾動方向代碼:
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(RecyclerView.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
嘗試
mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true));
假設您在 RecyclerView 中使用LinearLayoutManager ,那么您可以在LinearLayoutManager構造函數中將 true 作為第三個參數傳遞。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.