0

这是我的操作栏外观,我已经使用 actionbarsherlock 实现了这一点。如何自定义后退按钮和分隔符

在此处输入图像描述

4

2 回答 2

1

您可以使用 CustomViews 自定义您的操作栏。例如:

操作栏的布局:

<RelativeLayout
     android:layout_width="wrap_content"
     android:layout_height="wrap_content">

     <TextView 
          android:id="@+id/tvTitle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"/> 

</RelativeLayout>

然后你必须将此布局设置为自定义视图:

View actionbarView = getLayoutInflater().inflate(R.layout.actionbar, null);
getSupportActionBar().setCustomView(actionbarView);

我不建议您自定义后退按钮的外观,因为它在 android 中是标准的。

于 2013-07-06T12:00:47.587 回答
0

它实际上是一个“向上”按钮,可以通过在您的主题中覆盖此标签来自定义:

<item name="android:homeAsUpIndicator">@drawable/ic_action_up</item>

ic_action_up要使用的自定义 Drawable在哪里。

于 2013-07-06T12:00:14.220 回答