且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在ActionBar中可绘制的后退箭头的ID是什么?

更新时间:2023-01-10 10:31:03

如果您的项目中有支持库,则可以在应用程序中的任何位置创建后退按钮,如下所示:

If you have the support library in your project, you can make a back button in any place in your applicaction like this:

<ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="?attr/homeAsUpIndicator"
        android:background="?attr/selectableItemBackgroundBorderless"/>

具体来说,后退箭头的资源是?attr/homeAsUpIndicator.

Specifically the resource for the back arrow is ?attr/homeAsUpIndicator.