[英]vertical scroll bar not visible inside horizontal scroll bar android
我有一個水平的垂直滾動條。 僅當我向右水平滾動時,垂直滾動條才可見。 但我希望它始終可見。
我怎樣才能做到這一點? 有幫助嗎? 提前致謝
我的xml看起來像這樣
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/gridTitle"
android:layout_marginLeft="30dp"
android:layout_marginRight="18dp"
android:layout_marginBottom="5dp"
android:fadeScrollbars="false" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="13dp">
<!-- This Table Layout is header followed by the table itself-->
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:stretchColumns="*" >
<TableRow
android:id="@+id/tableHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TableRow>
</TableLayout>
<ScrollView
android:id="@+id/verticalScroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadeScrollbars="false">
<TableLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:stretchColumns="*" >
</TableLayout>
</ScrollView>
</LinearLayout>
</HorizontalScrollView>
編輯:
問題是,垂直滾動條在屏幕之外(如果我有很多表格列),所以我只能在水平滾動時看到它。但我希望它始終可見。
只需刪除
android:fadeScrollbars="false"
排隊或使其成true
。 在這里閱讀
android:fadeScrollbars =>定義在不使用時是否淡出滾動條。
編輯
請在視圖中嘗試以下兩行。 我刪除行android:fadeScrollbars="false"
並添加2行以下。
android:scrollbarFadeDuration="0"
android:scrollbarDefaultDelayBeforeFade="0"
使用ScrollView.setScrollbarFadingEnabled(false);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.