你好我的朋友我是新的Android开发者。我正在尝试制作应用程序。我的应用程序在我的手机中成功运行了android 6.0但app不在kitkat中工作。请帮我!我尝试了一切。
activity_main.xml中
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
app_bar_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
/>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
Myactivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
....
答案 0 :(得分:0)
我遇到了同样的问题:
启动画面仅在像Kitkat这样的低级版本中不起作用。后来 我知道错误不在我的代码中。
我使用刚删除的可绘制图像设置了启动画面背景。因此,请检查您的应用中是否有任何图片。