Android ViewPager不遵守LinearLayout内部的顺序
我有这个XMLAndroid ViewPager不遵守LinearLayout内部的顺序,android,Android,我有这个XML <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" an
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/blanco"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verde_us" >
<ImageView
android:id="@+id/detalle_imagen_categoria"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:src="@drawable/icon_map" />
<View
android:id="@+id/View02"
android:layout_width="2dp"
android:layout_height="fill_parent"
android:background="@color/blanco" />
<TextView
android:id="@+id/text_nombre_empresa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:text="@string/text_noticias"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/blanco" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</android.support.v4.view.ViewPager>
</LinearLayout>
但当我运行应用程序时,输出是另一个
有什么帮助吗?谢谢
我想要在XML中显示“Ahumadero”的文本下面的选项卡
然后停止使用操作栏选项卡。为您的
ViewPager
使用其他类型的选项卡式指示器,您可以通过将其放置在线性布局中来控制位置。有许多开源实现,例如pagerslidingtastrip
输出的是覆盖整个屏幕的ViewPager?您能更具体地描述一下它的外观吗?查看您的屏幕截图和XML文件时,我并没有立即明白为什么ViewPager不尊重LinearLayout内部的顺序是的,它确实。。。很抱歉,您使用了错误的选项卡。。。(在actionbar上?)为什么您的viewPager具有匹配的父级高度?同意。假设Ahumadero内容位于ViewPager
中,您请求的布局似乎就是您得到的布局。预览版不会显示操作栏选项卡,部分原因是预览版不知道这些选项卡,部分原因是Android 5.0中不推荐使用操作栏选项卡。好的,我会尝试发表评论。