这是我的两个 @L_502_0@版本的ScreenShot.
Kitkat版本:
棒棒糖版:
这可能是背后的原因.
清单文件
<?xml version="1.0" enCoding="utf-8"?><manifest xmlns:androID="http://schemas.androID.com/apk/res/androID" package="com.global.market"> <uses-permission androID:name="androID.permission.INTERNET" /> <uses-permission androID:name="androID.permission.ACCESS_NETWORK_STATE" /> <application androID:allowBackup="true" androID:icon="@mipmap/image_front" androID:label="@string/app_name" androID:supportsRtl="true" androID:theme="@style/Apptheme"> <activity androID:name=".MainActivity" androID:label="@string/app_name" androID:theme="@style/Apptheme.NoActionbar"> <intent-filter> <action androID:name="androID.intent.action.MAIN" /> <category androID:name="androID.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity androID:name=".detailactivity" androID:label="@string/app_name" /> <activity androID:name="com.Google.androID.gms.ads.AdActivity" androID:configChanges="keyboard|keyboardHIDden|orIEntation|screenLayout|uiMode|screenSize|smallestScreenSize"/> <Meta-data androID:name="com.Google.androID.gms.version" androID:value="6111000" /> </application></manifest>
Styles.xml文件
<resources><!-- Base application theme. --><style name="Apptheme" parent="theme.AppCompat.light.DarkActionbar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="windowActionbarOverlay">false</item> <item name="windowNoTitle">true</item> <item name="windowActionbar">false</item></style><style name="Apptheme.NoActionbar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="windowActionbar">false</item> <item name="windowNoTitle">true</item></style><style name="Apptheme.AppbarOverlay" parent="themeOverlay.AppCompat.Dark.Actionbar" /><style name="Apptheme.PopupOverlay" parent="themeOverlay.AppCompat.light" />
activity_main.xml中
<?xml version="1.0" enCoding="utf-8"?><androID.support.v4.Widget.DrawerLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:app="http://schemas.androID.com/apk/res-auto" xmlns:ads="http://schemas.androID.com/apk/res-auto" xmlns:tools="http://schemas.androID.com/tools" androID:ID="@+ID/drawer_layout" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:fitsSystemwindows="true" tools:openDrawer="start"> <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" androID:clickable="true"> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="vertical"> <ExpandableListVIEw androID:ID="@+ID/exp_List" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:layout_margintop="160dp" androID:indicatorRight="?androID:attr/expandableListPreferredItemIndicatorRight" androID:background="@androID:color/white" androID:footerdivIDersEnabled="true" androID:groupIndicator="@null"> </ExpandableListVIEw> <!--<ListVIEw--> <!--androID:background="@androID:color/white"--> <!--androID:ID="@+ID/menuList"--> <!--androID:layout_wIDth="match_parent"--> <!--androID:layout_height="match_parent"--> <!--androID:layout_margintop="10dp" />--> </linearLayout> </androID.support.design.Widget.NavigationVIEw></androID.support.v4.Widget.DrawerLayout>
MainActivity.java
@OverrIDe protected voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.activity_main); Toolbar toolbar = (Toolbar) findVIEwByID(R.ID.toolbar); if (toolbar != null) { toolbar = (Toolbar) findVIEwByID(R.ID.toolbar); setSupportActionbar(toolbar); getSupportActionbar().setdisplayHomeAsUpEnabled(true); }}
Build.gradle文件
apply plugin: 'com.androID.application'androID { compileSdkVersion 23 buildToolsversion "23.0.3" ext { supportlibVersion = '23.4.0' // variable that can be referenced to keep support libs consistent } defaultConfig { applicationID "com.global.market" minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionname "1.0" } buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'),'proguard-rules.pro' } }}dependencIEs { compile filetree(dir: 'libs',include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.androID.support:appcompat-v7:23.4.0' compile 'com.androID.support:design:23.4.0' compile 'com.loopj.androID:androID-async-http:1.4.9' compile 'com.androID.support:cardvIEw-v7:23.0.+' compile 'com.androID.support:recyclervIEw-v7:23.0.+' compile 'com.Google.code.gson:gson:2.6.2' compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.1.0' compile 'com.github.gabrIElemariotti.cards:cardslib-core:2.1.0' compile 'com.github.gabrIElemariotti.cards:cardslib-cards:2.1.0' compile 'com.github.PhilJay:MPAndroIDChart:v2.2.4' compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar') compile 'com.Google.androID.gms:play-services:6.1.11'}解决方法 默认情况下,Appbar具有在棒棒糖之后工作的高程.因此,尽管布局层次结构,它始终可见.但是在较低版本(在棒棒糖下面),工具栏可能会在其他布局下方绘制.
因此,请重新排列布局项以使工具栏可见.
总结以上是内存溢出为你收集整理的版本控制 – 我的工具栏未在API级别19(Kitkat)上显示,而它显示为API级别21全部内容,希望文章能够帮你解决版本控制 – 我的工具栏未在API级别19(Kitkat)上显示,而它显示为API级别21所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)