为什么这个按钮没有显示

时间:2017-05-05 18:22:53

标签: android

我正试图在查看寻呼机下制作一个页脚,但它根本没有出现,我不明白为什么?这是我试过的,我在视图寻呼机下添加了按钮,但它没有出现!

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/activity_survay"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:orientation="vertical">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/ferani">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">


        <android.support.v4.view.ViewPager
            android:id="@+id/survey_pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true" />

        <Button
            android:id="@+id/login"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="right"
            android:layout_marginTop="5dp"
            android:background="@drawable/primary_round"
            android:padding="5dp"
            android:layout_weight="1"
            android:text="التالي" />
    </LinearLayout>
</LinearLayout>

1 个答案:

答案 0 :(得分:0)

No Need to use three Nested Linear Layout. Try this one:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_survay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/txt_color_white"
>
        <android.support.v4.view.ViewPager
            android:id="@+id/survey_pager"
            android:layout_width="match_parent"
            android:layout_above="@+id/login"
            android:layout_height="match_parent"
           />

        <Button
            android:id="@+id/login"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:padding="5dp"
            android:layout_alignParentBottom="true"
            android:text="التالي" />
</RelativeLayout>
相关问题