Java 如何使滚动活动的固定部分显示在每个屏幕大小上
如何在每个屏幕大小上显示滚动活动的固定部分? 我有一个可滚动的活动,其中包含一个pageviewer,下面有4个按钮。在一个普通的屏幕上,它只显示这些东西,其余的在屏幕下面,这意味着按钮下面没有更多的视图。如果我们使用更宽的屏幕,那么这些视图在滚动之前也会出现在主视图中。我需要使所有屏幕大小的视图范围相同,这意味着对于更宽的屏幕,我只需要查看页面查看器和按钮,其余的应该只有在滚动时才能看到。Java 如何使滚动活动的固定部分显示在每个屏幕大小上,java,android,android-layout,android-activity,android-scrollview,Java,Android,Android Layout,Android Activity,Android Scrollview,如何在每个屏幕大小上显示滚动活动的固定部分? 我有一个可滚动的活动,其中包含一个pageviewer,下面有4个按钮。在一个普通的屏幕上,它只显示这些东西,其余的在屏幕下面,这意味着按钮下面没有更多的视图。如果我们使用更宽的屏幕,那么这些视图在滚动之前也会出现在主视图中。我需要使所有屏幕大小的视图范围相同,这意味着对于更宽的屏幕,我只需要查看页面查看器和按钮,其余的应该只有在滚动时才能看到。 <?xml version="1.0" encoding="utf-8"?> <Lin
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/idd_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1">
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="500dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Button1" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Button1" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Button1" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Button1" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="other view" />
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="other view" />
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="other view" />
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="other view" />
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="other view" />
</LinearLayout>
</ScrollView>
</LinearLayout>
通过编程设置ViewPager高度,使其与手机高度相匹配我尝试通过编程设置ViewPager高度,使其与手机高度相匹配,但我找不到正确的方法