Android 为什么此布局的上部不显示?
这是我的布局。问题是PageViewer的内容要么是可见的,要么没有其他内容。如果我看到PageViewer消失了,我会看到上面的一切。还尝试将根布局作为框架布局,但没有帮助。最重要的是,只有查看寻呼机是可见的。我想要的是2/3的ViewPager内容,其中包含数据,并且在某些标题材料之上是1/3。我不想使用砝码,因为上部尺寸已经正确。我只是想保证top和pageviewer都能正确显示。页面浏览者的特点是什么都切换吗?或者它们不能应用于另一个元素之下Android 为什么此布局的上部不显示?,android,android-layout,Android,Android Layout,这是我的布局。问题是PageViewer的内容要么是可见的,要么没有其他内容。如果我看到PageViewer消失了,我会看到上面的一切。还尝试将根布局作为框架布局,但没有帮助。最重要的是,只有查看寻呼机是可见的。我想要的是2/3的ViewPager内容,其中包含数据,并且在某些标题材料之上是1/3。我不想使用砝码,因为上部尺寸已经正确。我只是想保证top和pageviewer都能正确显示。页面浏览者的特点是什么都切换吗?或者它们不能应用于另一个元素之下 <?xml version="1.0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mHeaderHeader"
android:visibility="visible"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<include
android:id="@+id/myInclude"
layout="@layout/myInclude_layout" />
<include
android:id="@+id/myInclude2r"
layout="@layout/myInclude2" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</FrameLayout>
<include
android:id="@+id/myInclude3"
layout="@layout/myinclude3layout" />
<ImageView
android:id="@+id/myImageView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/myViewPager"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<include layout="@layout/myinclude4" />
</LinearLayout>
您可以尝试以下方法:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mHeaderHeader"
android:visibility="visible"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:orientation="vertical">
<include
android:id="@+id/myInclude"
layout="@layout/myInclude_layout" />
<include
android:id="@+id/myInclude2r"
layout="@layout/myInclude2" />
<include
android:id="@+id/myInclude3"
layout="@layout/myinclude3layout" />
<ImageView
android:id="@+id/myImageView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<include layout="@layout/myinclude4"
android:id="@+id/myinclude4" />
<android.support.v4.view.ViewPager
android:id="@+id/myViewPager"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBelow="@id/mHeaderHeader"
android:layout_alignAbove="@id/myinclude4" />
</RelativeLayout>
我想ViewPager占用了所有空间,所以我使用RelativeLayout将其放置在页眉下方和页脚上方