Android Studio layer-list render - android

After wrote layer-list I got some error, refresh it but not working.
This is the image of error I got when after place this layer-list.

May be your xml file is in layout folder.
Move your xml file to drawable folder. And check it.
Hope this may help.

The above solution worked. but why won't place drawbale folder? isn't it a layout?

Related

error with fab button design with vector assets

I have used the dependencies to be used as suggested. below is the pic.
build_gradle(module)
now I have selected a black plus icon from vector assets and named it as fab_plus, now I have this file in my drawable folder.
fab_plus_XML
now I tried to used that fab_plus_XML like this. Pic below.
activity_main
Now my question is why is the fab_plus is showing in red.
thanks in advance. pls, help me, someone.
There are two things wrong with the way you are specifying the drawable. To refer to a drawable within your project, you simply use #drawable/your_drawable and to allow backward compatibility of VectorDrawables you should use app:srcCompat as per the guidance.
So in your ImageView, instead of
android:src="#android:drawable/fab_plus"
you should have
app:srcCompat="#drawable/fab_plus"
You will also need to make sure the app namespace is included at the top of your layout xmlns:app="http://schemas.android.com/apk/res-auto" along with the current android and tools namespaces.
you need to use:
app:srcCompat
instead of
android:src
but the tooltip there should exactly tell you this and AFAIR even offer a quick-fix

I want to use Resource !! (Xamarin.Forms 's custom renderer)

I'm trying to making a Table with Xamarin.Forms for Android.
First, there is no border on Table. So!
I made a border.xml file and make shape
but when I do build this, an error occurred
'Invalid start tag shape'
I want to know how to fix it.
And ! , Sorry for more question,
after make resource .xml file I want to put in SetBackgroundResource(int resid)
using resid in Resource.Designer.cs.
How I make resid(resource id) for border.xml 's shape and use it?
Thank you Soooooooooooooo much!
When I had a similar problem, I had created a Converter. You can find more example on Xamarin site https://developer.xamarin.com/guides/xamarin-forms/advanced/localization/

I hava a custom resource file which path is :app/values/defaults.xml in my app

I have defined a custom resource file which path is :app/res/values/defaults.xml in my app,but when i use the resources in other files,the IDE show me the error like the screenshot below.I have no idea how to solve this problem.
android studio show me the error like this
The error tell you that your color cpb_default_color its not create in values/color you must create first this variable in values/colors like this
<color name="cpb_default_color">#yourHexColor</color>
Hope to help!
You should place all your colors in colors.xml

Android Studio resource dialogue is not showing my project drawables

I have encountered the following issue in Android Studio: when I select the "..." to specify the source drawable file for an ImageView, in the Project tab I don't see the project drawables, even if they do appear into the drawable folder on the left pane, but instead a long list of (I guess) system drawables (whose name is starting with "abc_") and no trace of the custom files I have successfully pasted into the project drawable folders.
If I try to write manually a reference to the correct resource in XML (android:src="#drawable/main_title"), I get the following error popup:
Rendering Problems Couldn't resolve resource #drawable/main_title. Failed to convert #drawable/main_title into a drawable.
Does anybody have any idea of what's happened? Thank you in advance.
You're trying to put in android:src a string, not a Drawable. If you want to apply drawable to your ImageView src you should use somthing like this:
android:src="#drawable/your_image_drawable"
I just found my own mistake: I pasted the drawable files inside the drawable folder, while they must reside inside the res folder. Now it works.
Thanks for your replies.

Changing tab color on Android works partially

I've been trying to change tab colors of my android app. But i can't get it done. I've copied all the needed images and repainted them in Photoshop. But this is all i get.
What i first did was copy the tab_indicator.xml from the drawable folder in android-sdk\platforms\android-8\data\res\drawable.
Then i copied all the images that are referenced in that xml file to my own drawable-hdpi folder. I copied those image from the android-sdk\platforms\android-8\data\res\drawable-hdpi folder.
I re-painted the tab_unselected.png file like this:
Orignal file (tab_unselected.9.png):
New file:
But as you can see in the top screenshot, only the borders are colored. The tab itself just remains black when unselected.
What do i have to do to style that tab without the use of any Java code. I don't mind adding any XML files or editting .png files.
BTW, i added a custom TabHost xml file in my layout folder and added android:background="#drawable/tab_indicator" to the TabWidget tag.
if you wanna change only tab color you not required to use png files. Take a look here, hope it will be helpfull http://joshclemm.com/blog/?p=136

Categories

Resources