2017-05-05 129 views
0

我試圖在查看傳呼機下做一個頁腳但它並沒有出現,我不知道爲什麼?這是我試過的,我添加了查看傳呼機下的按鈕,但它並沒有出現!爲什麼這個按鈕不顯示

<?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

這看起來像一個無效的佈局。我看到3'LinearLayout'開始標記,但只有2個結束標記 –

+0

嗯,它是一段代碼而不是完整的代碼,我已經編輯了我的代碼請指教 –

+0

@HabooltakAna如果這只是完整代碼的一小部分,我只能說是 - 你錯過了一個''如果你的完整代碼包含了那個缺失的部分,那麼它就是其他的東西。 – Dayan

回答

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> 
+0

我會盡力做到這一點,謝謝:) 但這種佈局不會作爲根,因爲有很多組件在那裏沒有出現在我的問題 –

0

你viewPager是match_parent而按鈕match_parent太並且重

你應該嘗試把0dp寬度和設置權重,以他們兩人 也是你的第二個線性佈局似乎沒用,因爲默認情況下它將應用垂直方向

+0

我增加了頁腳的重量,但它並沒有出現在所有 –

相關問題