我想让我的布局像这样
对于ViewPagerIndicator,我使用了线性布局,对于跳过和下一个使用了平面按钮。
从下面的代码中,我得到的输出为
我需要在这里帮助。
这是我的布局:
<LinearLayout
android:id="@+id/viewPagerCountDots"
android:layout_width="match_parent"
android:layout_height="@dimen/pager_height"
android:layout_above="@+id/ll_footer"
android:layout_marginBottom="12dp"
android:layout_alignParentLeft="true"
android:gravity="center"
android:orientation="horizontal" >
<com.gc.materialdesign.views.ButtonFlat
android:id="@+id/skip"
android:layout_width="72dp"
android:layout_height="wrap_content"
android:layout_above="@id/viewPagerCountDots"
android:layout_gravity="start"
android:gravity="start"
android:text="Skip"
/>
<com.gc.materialdesign.views.ButtonFlat
android:id="@+id/next"
android:layout_width="72dp"
android:layout_height="wrap_content"
android:layout_above="@id/viewPagerCountDots"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:gravity="end"
android:text="Next" />
</LinearLayout>
我检查布局后,问题出在linearLayout上你可以试试这个
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/viewPagerCountDots"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="50dp"
android:gravity="center"
android:orientation="horizontal"/>
<Button
android:id="@+id/skip"
android:layout_width="72dp"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:gravity="start"
android:text="Skip"
android:layout_alignParentBottom="true"/>
<Button
android:id="@+id/next"
android:layout_width="72dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_gravity="end"
android:gravity="end"
android:text="Next" />
</RelativeLayout>