2015-02-23 46 views
1

enter image description here在Android中5.0列表視圖元組重疊底杆

我在我的活性,其被動態填充片段一個viewpager。 片段含有這是造成這一問題的列表視圖,因爲它重疊關係5.0底杆(它可以是一種棒棒糖問題,因爲它的工作罰款在其他設備上。)

含有的ViewPage活性佈局如下:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="@dimen/view_label_min_height" 
    android:background="@color/background_material_light" 
    android:orientation="horizontal"> 

    <RelativeLayout 
     android:id="@+id/notYetCalledTab" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:background="@drawable/item_selected_background_drawable"> 

     <TextView 
      android:id="@+id/notYetCalled" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:gravity="center" 
      android:padding="8dp" 
      android:text="No action taken" 
      android:textColor="@color/textColor" /> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="3dp" 
      android:layout_alignParentBottom="true" 
      android:background="@drawable/tab_indicator_drawable" /> 

    </RelativeLayout> 

    <View 
     android:layout_width="0.5dp" 
     android:layout_height="match_parent" 
     android:background="@color/strokeColor" /> 

    <RelativeLayout 
     android:id="@+id/todayTab" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:background="@drawable/item_selected_background_drawable"> 

     <TextView 
      android:id="@+id/today" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:gravity="center" 
      android:padding="8dp" 
      android:text="Today's" 
      android:textColor="@color/textColor" /> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="3dp" 
      android:layout_alignParentBottom="true" 
      android:background="@drawable/tab_indicator_drawable" /> 


    </RelativeLayout> 

    <View 
     android:layout_width="0.5dp" 
     android:layout_height="match_parent" 
     android:background="@color/strokeColor" /> 

    <RelativeLayout 
     android:id="@+id/pastTab" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:background="@drawable/item_selected_background_drawable"> 

     <TextView 
      android:id="@+id/past" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:gravity="center" 
      android:padding="8dp" 
      android:text="Past" 
      android:textColor="@color/textColor" /> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="3dp" 
      android:layout_alignParentBottom="true" 
      android:background="@drawable/tab_indicator_drawable" /> 


    </RelativeLayout> 

    <View 
     android:layout_width="0.5dp" 
     android:layout_height="match_parent" 
     android:background="@color/strokeColor" /> 

    <RelativeLayout 
     android:id="@+id/upcomingTab" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:background="@drawable/item_selected_background_drawable"> 

     <TextView 
      android:id="@+id/upcoming" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:gravity="center" 
      android:padding="8dp" 
      android:text="Upcoming" 
      android:textColor="@color/textColor" /> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="3dp" 
      android:layout_alignParentBottom="true" 
      android:background="@drawable/tab_indicator_drawable" /> 


    </RelativeLayout> 

</LinearLayout> 

<View 
    android:layout_width="match_parent" 
    android:layout_height="0.5dp" 
    android:background="@color/strokeColor" /> 

<android.support.v4.view.ViewPager 
    android:id="@+id/viewPager" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/background_material_light" /> 
</LinearLayout> 

和包含列表視圖片段的佈局如下:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <ListView 
     android:id="@+id/list" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:dividerHeight="8dp" 
     android:divider="@android:color/transparent" 
     android:padding="8dp"/> 
</RelativeLayout> 

請幫助我。提前致謝 !!!

回答

0

研究發現,在導航欄獲取佈局的未來,爲了避免這一點,你需要調用窗口設置回

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);