我见过一些应用程序在屏幕底部有一个稍微半透明的黑色条,上面有按钮,中间有一个菜单栏。我想知道如何创建这样的东西。
最佳答案
你可以这样做:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#AAFFFFFF">
<ImageButton android:src="@drawable/left_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"/>
<TextView android:text="@string/your_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentCenter="true"/>
<ImageButton android:src="@drawable/right_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
</RelativeLayout>
注意我选择的android:background
颜色。可能是错误的。
关于Android:如何创建导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5291413/