Android 添加与iOS设备上的工具栏类似的底部工具栏
是否可以在Android的底部添加工具栏,类似于iOS设备上的工具栏Android 添加与iOS设备上的工具栏类似的底部工具栏,android,Android,是否可以在Android的底部添加工具栏,类似于iOS设备上的工具栏 您可以使用新的Android工具栏小部件: 这篇文章很好地描述了如何在应用程序中使用工具栏 您可以使用新的Android工具栏小部件: 这篇文章很好地描述了如何在应用程序中使用工具栏 您可以使用布局中的工具栏根据需要制作页脚: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android
您可以使用新的Android
工具栏
小部件:
这篇文章很好地描述了如何在应用程序中使用工具栏
您可以使用新的Android
工具栏
小部件:
这篇文章很好地描述了如何在应用程序中使用工具栏
您可以使用布局中的工具栏根据需要制作页脚:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- // Main content comes here -->
<!-- Footer -->
<RelativeLayout android:id="@+id/footer"
android:layout_width="fill_parent" android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content">
<LinearLayout
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
添加toolbar.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="@dimen/abc_action_bar_default_height_material">
<!-- One can customize it as much as he wants, for showing an example,
I have shown below how to add an image at the center of toolbar-->
<ImageView
android:layout_width="wrap_content"
android:contentDescription="@string/logo"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_launcher"/>
</android.support.v7.widget.Toolbar>
您可以使用布局中的工具栏根据需要制作页脚:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- // Main content comes here -->
<!-- Footer -->
<RelativeLayout android:id="@+id/footer"
android:layout_width="fill_parent" android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content">
<LinearLayout
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
添加toolbar.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="@dimen/abc_action_bar_default_height_material">
<!-- One can customize it as much as he wants, for showing an example,
I have shown below how to add an image at the center of toolbar-->
<ImageView
android:layout_width="wrap_content"
android:contentDescription="@string/logo"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_launcher"/>
</android.support.v7.widget.Toolbar>
带一些文本视图的RelativeLayout怎么样?第一张图片中1个文本视图,第二张图片中3个。是的,我认为这是个好主意。我想你已经准备好了。只需在屏幕底部安装一个小部件,也许是框架布局或相对布局,ActionBar也有一个“拆分”模式,可以做类似的事情。还有一个工具栏类,可以作为ActionBar,你可以根据自己的意愿定位。谢谢@Egor,你有这个工具栏类的链接或示例吗?有一些文本视图的RelativeLayout怎么样?第一张图片中1个文本视图,第二张图片中3个。是的,我认为这是个好主意。我想你已经准备好了。只需在屏幕底部安装一个小部件,也许是框架布局或相对布局,ActionBar也有一个“拆分”模式,可以做类似的事情。还有一个工具栏类,可以作为ActionBar,你可以根据自己的意愿定位。谢谢@Egor,您是否有此工具栏类的链接或示例。