android-appcompat

Couldn't show items with AppCompat library

爷,独闯天下 提交于 2019-12-29 07:43:09
问题 I am having some troubles to show items in the ActionBar with AppCompat. This code works on a normal actionbar <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/item1" android:showAsAction="always" android:title="Se connecter" android:visible="true"> </item> </menu> But with the AppCompat library the item isn't shown.. What should I do ? Thanks in advance :) 回答1: showAsAction is not in the android xml namespace for API < 11 try something like the

Cannot resolve symbol Theme, ThemeOverlay

末鹿安然 提交于 2019-12-29 06:37:27
问题 I updated my android studio to latest version - 3.0.1. Since then it complains 'Cannot resolve symbol' for Theme and ThemeOverlay in the following lines of code. App runs fine but they are marked in RED in the file. styles.xml <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"></style> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> build.gradle is updated with

AppCompat v7 Toolbar onOptionsItemSelected not called

孤人 提交于 2019-12-29 03:32:15
问题 I changed from the original ActionBar to the AppCompat Toolbar and setSupportActionBar(toolbar). When I am using getSupportActionBar() and setDisplayHomeAsUpEnabled(true) for the back arrow, the click never calls onOptionsItemSelected or any other listener method. Do I have to implement some special listener for it? Befor everything was working just fine. EDIT: Initialise the ActionBar: mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); mActionBar =

Appcompat library for android - how it's linked with project

风格不统一 提交于 2019-12-29 02:16:49
问题 In which way is android appcompat library linked with a project (where in code is that connection visible)? I tried to rename it just to see what's gonna happen and my project gave me errors everywhere... Also, is it possible to somehow use only one appcompat library for all projects? 回答1: In Eclipse, to share the appcompat libraries across multiple Android projects, do the following: In Eclipse, select File | Import | Existing Projects into workspace . click Next . Click Browse , and browse

“You need to use a Theme.AppCompat theme (or descendant) with the design library” error

霸气de小男生 提交于 2019-12-28 18:09:50
问题 I'm getting "You need to use a Theme.AppCompat theme (or descendant) with the design library" error every time even if I'm obviously using an AppCompat Theme (a descendant one). dependencies: compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' compile 'com.android.support:support-v4:23.3.0' layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns

Changing Background and text color of AppCompat Light DarkActionBar Theme on android

别来无恙 提交于 2019-12-28 12:18:26
问题 I have used AppCompat Light DarkActionBar Theme for my App. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> Is it possible to change the background color and text color of this ActionBar ? If yes, how ? 回答1: The following code will allow you to completely style the action bar. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarStyle">@style/Widget.AppTheme.ActionBar</item> <item name="actionBarTheme">@style/ThemeOverlay

Changing Background and text color of AppCompat Light DarkActionBar Theme on android

橙三吉。 提交于 2019-12-28 12:18:22
问题 I have used AppCompat Light DarkActionBar Theme for my App. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> Is it possible to change the background color and text color of this ActionBar ? If yes, how ? 回答1: The following code will allow you to completely style the action bar. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarStyle">@style/Widget.AppTheme.ActionBar</item> <item name="actionBarTheme">@style/ThemeOverlay

Why doesn't my Lollipop ActionBar show any color (essentially colorPrimary)?

↘锁芯ラ 提交于 2019-12-25 13:10:33
问题 I wrote this SSCCE to demonstrate the problem. The emulator is NexusFive but it is customised to use API22. SSCCE res/values/colors.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="primaryColor">#69F0AE</color> <!-- Light ferozi --> <color name="primaryColorDark">#00E676</color> <!-- Darker Ferozi --> <color name="accentColor">#F44336</color> <!-- Red 500 --> </resources> res/values/styles.xml <resources> <style name="AppBaseTheme" parent="Theme.AppCompat"></style> <style

Android: Issues with R after importing v7 appcompat

假装没事ソ 提交于 2019-12-25 09:25:35
问题 I imported the v7-appcompat support library following the instructions on the android developer site, and ran into the missing R issue that many other users have encountered. I've read through several similar questions users have posted here, and tried what was suggested but I'm still getting the missing R problem. I've re-imported the appcompat library, cleaned my project, restarted eclipse, changed my min and target SDK in both the manifest and properties, and still have the same issue. The

Android: Issues with R after importing v7 appcompat

前提是你 提交于 2019-12-25 09:21:03
问题 I imported the v7-appcompat support library following the instructions on the android developer site, and ran into the missing R issue that many other users have encountered. I've read through several similar questions users have posted here, and tried what was suggested but I'm still getting the missing R problem. I've re-imported the appcompat library, cleaned my project, restarted eclipse, changed my min and target SDK in both the manifest and properties, and still have the same issue. The