我创建了DrawerLayout,Min-Sdk是11(也不能更改Min-Sdk)。我需要将ActionBar更改为RTL并更改菜单图标。我找到的所有解决方案都需要Min-Sdk 17,有什么办法吗?

我可以在Eclipse中使用ActionBarRTLizer,在Sdk-11中使用ActionBarRTLizer工作吗?
如何在项目中导入ActionBarRTLizer?
发布于 2016-08-25 18:30:11
我确实建议使用工具栏而不是ActionBar (ActionBarRTlize是相对较旧的存储库)。通过使用工具栏,您可以轻松地自定义它(RTL或任何您想要的东西)。
下面是我最近工具栏的一个片段,可以帮助您:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/gray_lighter"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<!--selectableItemBackgroundBorderless-->
<ImageButton
android:id="@+id/icon_toolbar_back"
style="@style/IconFont.XLarge"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@drawable/selector_button_toolbar"
android:clickable="true"
android:focusable="true"
android:minWidth="56dp"
/>
<TextView
android:id="@+id/text_toolbar_title"
style="@style/Textview.Dark.MediumLarge"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginRight="48dp"
android:layout_toRightOf="@+id/icon_toolbar_back"
android:gravity="center" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>还有一点要提的是,不要忘记将主题更改为NoActionBar
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>https://stackoverflow.com/questions/39152093
复制相似问题