简体   繁体   English

Android标题和主页按钮作为单个后退按钮

[英]Android title and home button as single back button

How to achieve the same result as in standard android messaging application, where the back button is united with the title: 如何获得与标准android消息传递应用程序中相同的结果,其中后退按钮与标题结合在一起: 在此处输入图片说明

Simply set the button to go back to the previous activity/intent. 只需设置按钮即可返回上一个活动/意图。 If this isn't what you wanted, I'm not sure I understood your question properly. 如果这不是您想要的,则不确定我是否正确理解了您的问题。

Use Android: Go back to previous activity if that's what you wanted. 使用Android:如果需要的话,请返回上一个活动

<Button
android:id="@+id/back"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="set_your_title"
android:drawableLeft="@android:drawable/back"
android:textSize="24sp"/>

You can set the layout width according to your layout requirements. 您可以根据布局要求设置布局宽度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM