[英]How to display an image on action bar that is half outside
The button is called a Floating action button or "FAB". 该按钮称为浮动动作按钮或“ FAB”。 What you want is a FAB on a CoordinatorLayout. 您想要的是CoordinatorLayout上的FAB。 For further reading you can go here: 要进一步阅读,您可以转到此处:
https://material.google.com/components/buttons-floating-action-button.html#buttons-floating-action-button-large-screens https://material.google.com/components/buttons-floating-action-button.html#buttons-floating-action-button-large-screens
https://guides.codepath.com/android/floating-action-buttons https://guides.codepath.com/android/floating-action-buttons
You should look for "FloatingActionButton". 您应该寻找“ FloatingActionButton”。
For example: 例如:
<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.