2016-07-31 5 views
-1

アクションバーの半分にある下の画像のようなボタンを追加しようとしています。私はそれが今日のように一般的なので、それを設計するための標準的な方法を探しています。半分の外側にあるアクションバーに画像を表示する方法

おかげ

enter image description here

+0

、それはとても明らかである場合、私は申し訳ありませんが、私は学習段階ではまだです。 – Shubh

+0

[FloatingActionButton](https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html) –

答えて

1

あなたが "FloatingActionButton" を探してください。例えば

:ボタンは、フローティングアクションボタンまたは "FAB" と呼ばれる

<android.support.design.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

     <LinearLayout 
      android:id="@+id/viewA" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="0.15"> 

      </LinearLayout> 

     <LinearLayout 
      android:id="@+id/viewB" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="0.85" > 

     </LinearLayout> 

    </LinearLayout> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/btn_add" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_margin="@dimen/activity_horizontal_margin" 
     android:clickable="true" 
     android:src="@drawable/ic_ok" 
     app:layout_anchor="@id/viewA" 
     app:layout_anchorGravity="left|bottom" 
     app:backgroundTint="@color/accent"/> 

</android.support.design.widget.CoordinatorLayout> 
関連する問題