[英]How to create circle imageview with a transparent border?
您的对话框有一些类似于BottomAppBar
和FloatingActionButton
View
。 当然,可以编写一个看起来就像一个BottomAppBar
的自定义View
,但是使用原始的东西更容易。
您可以为对话框使用以下布局(我省略了按钮栏,因为我认为您已经知道您可以使用例如LinearLayout
来实现这一点):
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bar"
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_gravity="bottom"
app:backgroundTint="#0000ff"
app:fabAlignmentMode="center"
app:fabCradleMargin="4dp"
app:fabCradleRoundedCornerRadius="0dp"
app:fabCradleVerticalOffset="4dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="12sp"
android:text="@string/lorem_string"
android:lines="3"
android:ellipsize="end"
android:padding="16dp"
android:layout_gravity="bottom"
/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="@id/bar"
app:elevation="0dp"/>
有关设置BottomAppBar
样式的更多信息,请参阅 开发人员文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.