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/
Related
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?
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 think i mentioned the name of the shape wrong.
I want to make shape like the following image with shadows in Android,
Sample model
So how to make this type of layout in Android .
thanx for the help!!
You should try this one:
https://github.com/Hitomis/CrazyShadow
By drawable you can generate the shape, and by using this library you will be able to add shadow.
Or:
You can use the library itself.
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
I am specifically looking for the drawable android.R.id.empty.
Does any one have an idea what the source path of that default Android drawable is?
The file where it is defined is located in
YOUR_SKD_DIRECTORY/platforms/A_PLATFORM/data/res/values/ids.xml
It is not a drawable but an id as you can clearly see from android.R.id.empty.
This id is meant to be set on a View which should be displayed in case your ListView is empty.
I stumpled upon a really nice guide for Froyo drawables. And don't forget to use android.R.drawables for your integer id. http://androiddrawableexplorer.appspot.com/