-1

如何添加分隔線以使其出現在動作欄下方和主/明細窗格上方?我已經定義了垂直分頻器,但不知道如何定義水平分頻器。如何在動作欄和其下面的佈局之間添加水平分隔線

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" 
    android:divider="@drawable/divider_vertical" 
    android:showDividers="middle" 
    android:baselineAligned="false" 
    tools:context=".MainActivity" > 

    <RelativeLayout 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:id="@+id/master_container"/> 

    <FrameLayout 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="3" 
     android:id="@+id/detail_container"/> 

</LinearLayout> 

divider_vertical.xml

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 
    <size android:width="1dp"/> 
    <solid android:color="#FFFFFF"/> 
</shape> 

divider_horizo​​ntal.xml

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 
    <size android:height="1dp"/> 
    <solid android:color="#FFFFFF"/> 
</shape> 

enter image description here

+0

你究竟想要分隔符? – varunkr

+0

在操作欄下方和主窗格/細節窗格上方 – MacaronLover

回答

1

我沒有看到代碼的工具欄,所以在我SENS e應該在工具欄下面有一個視圖,如下所示。我使用過材質設計工具欄,您可以使用任何工具欄。

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"> 

</android.support.v7.widget.Toolbar> 
      <View android:layout_height="0dp" 
        android:layout_width="fill_parent" 
        android:id="@+id/stripBelowToolbar"/> 
相關問題