2016-03-20 24 views
0

白いツールバーの下部に灰色の境界線を追加して、メインのコンテンツとはっきりと区別したいと思います。私が移動したときも、それをスクロールツールバーの下部にある小さな灰色の行を追加する必要がありツールバーの下部にある罫線を取得する方法は?

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:orientation="vertical" 
android:id="@+id/pick_root_layout"> 

<android.support.v7.widget.Toolbar 
    android:id="@+id/pick_toolbar" 
    android:layout_height="?attr/actionBarSize" 
    android:layout_width="match_parent" 
    android:minHeight="?attr/actionBarSize" 
    app:theme="@style/Toolbar.White" 
    android:background="@color/white"> 
</android.support.v7.widget.Toolbar> 

<android.support.v4.widget.SwipeRefreshLayout 
    android:id="@+id/swipe_refresh_layout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <ListView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/conversation_list"> 
    </ListView> 

</android.support.v4.widget.SwipeRefreshLayout> 

</LinearLayout> 

:私はこのように私のツールバーを設定しています。これどうやってするの?可能であれば、カスタムレイアウトを作成しないようにしたいと思います。

+0

それはあなたがリストビューをスクロールすると、ツールバーに添付たままになりますツールバーのドロップシャドウのタイプのエフェクトを望むように、これが正しいの音 – TrevJonez

答えて

0

ツールバーに付いたままのドロップシャドウタイプのエフェクトを追加しようとすると、SwipeRefreshLayoutをFrameLayoutで囲み、フォアグラウンドをFrameLayoutに配置するのが簡単です。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:orientation="vertical" 
    android:id="@+id/pick_root_layout"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/pick_toolbar" 
     android:layout_height="?attr/actionBarSize" 
     android:layout_width="match_parent" 
     android:minHeight="?attr/actionBarSize" 
     app:theme="@style/Toolbar.White" 
     android:background="@color/white"/> 

     <FrameLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:foreground="@drawable/bottom_shadow"> 

      <android.support.v4.widget.SwipeRefreshLayout 
       android:id="@+id/swipe_refresh_layout" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <ListView 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:id="@+id/conversation_list" /> 

      </android.support.v4.widget.SwipeRefreshLayout> 
     </FrameLayout> 
</LinearLayout> 

影9パッチ - ?>bottom_shadow.9.png

関連する問題