Android ActionBar /工具栏消失在我的应用程序中
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Android ActionBar /工具栏消失在我的应用程序中,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1669字,纯文字阅读大概需要3分钟。
内容图文
![Android ActionBar /工具栏消失在我的应用程序中](/upload/InfoBanner/zyjiaocheng/682/7e38d733b0c3482e936ac333b4e9171b.jpg)
所以我有一个应用程序.目前有3个活动…我正在用意图从另一个活动中启动活动
MainActivity > ChallongeLogin > ChallongeEvents
在我的MainActivity和ChallongeLogin中,应用程序顶部有一个大栏,列出了我的应用程序名称.但是,当我最终阅读ChallongeEvents时,该条消失了……我不记得做任何特别的事情使该条消失了.为什么消失了?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testing.testingapp">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:screenOrientation="portrait"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:screenOrientation="portrait"
android:name=".ChallongeLogin" />
<activity
android:screenOrientation="portrait"
android:name=".ChallongeEvents" />
</application>
</manifest>
解决方法:
根据您的要求,您必须扩展AppCompatActivity而不是Activity.
public class ActivityName extends AppCompatActivity {
// ...
}
AppCompatActivity is from the appcompat-v7 library. Principally, this
offers a backport of the action bar. Since the native action bar was
added in API Level 11, you do not need AppCompatActivity for that.
However, current versions of appcompat-v7 also add a limited backport
of the Material Design aesthetic, in terms of the action bar and
various widgets. There are pros and cons of using appcompat-v7, well
beyond the scope of this specific Stack Overflow answer.
参考
07001
内容总结
以上是互联网集市为您收集整理的Android ActionBar /工具栏消失在我的应用程序中全部内容,希望文章能够帮你解决Android ActionBar /工具栏消失在我的应用程序中所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。