Cannot resolve theme reference in Android Studio - android

I've recently added a light and darkmode theme to my android app, this works great in the app itself but in the design view on Android Studio, all elements like textviews, imageviews etc are all white and have this message: cannot resolve theme reference ?attr/textcustom
This goes for text, images, backgrounds. All with the same error
In this image you see all buttons, text etc are white. But when opening the app they get the correct colors etc.

Try changing the preview theme, the option is located right on top of the design panel:

Related

How to change my background theme in android studio

I change the theme in my android studio and it changes in all places, except in the background and in the code style, does anyone know how to change in these places, below I left a print to see that the code style is pretty ugly.
Follow Below steps -
Go to File and click on Settings.
Under the Appearance & Behaviour -> Appearance, find Theme.
Choose the Default theme from the drop-down and click on Apply and then Ok.
Here you can see the background and color scheme for all three themes.

Color of text in Android Studio

After update Android studio, the color of text in the following situation changes automatically...
I just cannot find the option in the Setting>Editor>Colors&Fronts.
Does anyone know where to set the text color back to white?
Any response will be helpful!
Android Studio have two themes built in, Default and Dracula.
Setting>Editor>Colors & Fonts > Choose Default, and if you want more style you can get at Color Themes.

Some style/theme attributes are not available in Android Studio

I recently started to learn Android development. But when I click themes, to change it, it says:
Rendering problems. Missing styles....
Then I can't push any Layout or view into the app.
I tried clicking Auto add all the missing attributes, but it doesn't do anything.
One of them works though - only the Manifest Theme.
These screenshot might help:
Screenshot 1
Screenshot 2
See in the image click on Overscan then the dialog is propmt change the Theme to Holo light the error will disappear.
Image :

Image recognised in Android Studio but invisible on Phone

My Images are being recognised like so (Look at the left):
However when I run the app on my phone the images just become invisible.
This just happened all of a sudden, I don't believe I changed anything other than copied other images into the folder, it seems like there is no consistency.
Also, I tried moving the icon images into the mipmap folders, specifically mdpi.
Still no luck. (So drawables and mipmap are broken?)
Any ideas?
Have you changed the theme recently?
If you have a white navigation bar but are using a dark theme, then the icons will show up white, regardless of the color you set them to.
So they are still there, but just the same color as the background.
Try changing the theme to a light theme.
If this works, but the rest of the app such as the Toolbar is not the correct color/theme, you can always override the theme for the Toolbar:
app:theme="#style/Dark.Overlay"

How to resolve theme warning in default Android Material Design project in Android Studio 1.4?

I'm trying new sample project with Android Material Design on Android Studio 1.4.
I created a project with an Empty Activity :
Everything works fine. However, from the beginning, we can notice that there are warnings at the Theme Editor:
1) Warning in ColorPrimary:
Not enough contrast with not enable textColorPrimary and default
textColorPrimary
2) Warning in android:textColorPrimary:
Not enough contrast with colorPrimary
My question is simple: How to resolve warnings?
I don't have Android Studio 1.4, but I can click the color box besides the warning to see the contrast problem on Android Studio 2.0.
Choose another color from the color gradient panel until the warning disappears.
If you want to show the same color i.e. #color/colorPrimary (#FF3F51B5) as in your case, then just change the Theme Parent from AppCompact Light (current) to AppCompact Dark
This will solve your problem.
In case if you want to choose some other color you can always twist around theme parent from dark to light or light to dark.
If you still did not get your choice result then the only option is to choose lighter color so that it can match contrast value with the theme.
Hope this helps.
Thank You!
the 2 cross in my case, one the colorprimary says it doesn't have enough contrast with textcolorprimary, and vise versa.
And i think it says the amount of contrast between the background, and the text, is not enough to be easily visible to the user, and the one who wrote the error, just didn't knew how to express it...

Categories

Resources