原链接: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"
 

相关文章:

  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-09-02
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2021-06-18
  • 2022-01-22
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案