安卓:在工具栏的布局画线/边界? [英] Android: Drawing a line/border in toolbar layout?
本文介绍了安卓:在工具栏的布局画线/边界?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的appBar应该是这样的要求:
I have the requirement that the appBar should look like this:
背景简直是透明的。
我用这个布局得到一个appBar(详细信息隐藏):
I use this layout to get an appBar (details hidden):
<android.support.v7.widget.Toolbar>
<TextView>
<ImageView>
</android.support.v7.widget.Toolbar>
简单地增加与高度= 1DP
下的的ImageView
与 layout_gravity =视图底部
将无法工作。
它甚至有可能画一条线或在边界 ToolbarLayout
Is it even possible to draw a line or a border in the ToolbarLayout
?
推荐答案
使用RelativeLayout的是这样的:
Using RelativeLayout like this:
<android.support.v7.widget.Toolbar>
<RelativeLayout>
<TextView>
<ImageView>
<View android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/button_menu"/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
这篇关于安卓:在工具栏的布局画线/边界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文