Android 問題解決 HorizontalScrollView顯示不全(轉)


原鏈接:https://www.jianshu.com/p/003adbcaff9d

Android 問題解決 HorizontalScrollView顯示不全

    <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="40dp" android:background="@color/about_dami_blue" android:fadingEdge="horizontal" android:scrollbars="none"> <LinearLayout android:id="@+id/ll_add_market" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="horizontal"> </LinearLayout> </HorizontalScrollView> 

通過代碼 動態添加標簽,但是 多了之后顯示不出來不能向做滑動

分析一下 問題出在

    LinearLayout 的屬性
     android:layout_gravity="center"

因為 水平滑動 還劇中顯示,顯然是計算有沖突。改為豎直解決問題。

android:layout_gravity="center_vertical"
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM