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