【发布时间】:2013-11-28 04:54:57
【问题描述】:
我目前有一个带有多个选项卡的操作栏,可以在不同的片段之间切换。我希望在下面有另一个“操作栏”来做同样的事情,最简单的方法是什么?
编辑:认为我应该澄清这就是我现在拥有的:http://i.imgur.com/kYtpUzt.jpg,这就是我想要实现的目标:http://i.imgur.com/q2DYIJT.png
【问题讨论】:
标签: java android tabs android-actionbar
我目前有一个带有多个选项卡的操作栏,可以在不同的片段之间切换。我希望在下面有另一个“操作栏”来做同样的事情,最简单的方法是什么?
编辑:认为我应该澄清这就是我现在拥有的:http://i.imgur.com/kYtpUzt.jpg,这就是我想要实现的目标:http://i.imgur.com/q2DYIJT.png
【问题讨论】:
标签: java android tabs android-actionbar
// Custom action bar
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setCustomView(R.layout.action_bar);
TextView title = (TextView) findViewById(android.R.id.text1);
title.setText("Profile");
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="@style/AppTheme"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ellipsize="end"
android:gravity="center_vertical" >
</TextView>
【讨论】: