【发布时间】:2017-08-11 12:06:38
【问题描述】:
我的 Android 应用程序上有一个 FrameLayout,但我无法使此布局的一部分可滚动...我尝试了一些解决方案来解决此问题,但我找不到补丁! 实际上,我希望在 Scrollview 标签之间看到可滚动的线性布局(也许,线性布局不是必需的)。
这是我的 xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.robertot.timereport.com.robertot.timereport.Pages.YearlyStatFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
// Some views to scroll
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/bottom_linear"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:layout_gravity="bottom"
style="@android:style/Widget.Holo.Light.ActionBar.Solid">
<Spinner
android:id="@+id/spnYearY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"/>
<ImageButton
android:id="@+id/btnFilter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_search"
android:background="@null"
android:layout_weight="1"
android:layout_gravity="center_vertical"/>
</LinearLayout>
</FrameLayout>
谢谢!! :)
【问题讨论】:
-
谢谢!它有效,但还有另一个问题:最后一个 LinearLayout (id/bottom_linear) 隐藏可滚动视图...我该如何解决?谢谢!
标签: android xml android-layout scroll