Issue
Can we add multiple styles for different components in one xml file in drawable folder? For example, Code for one button
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/colorDarkBlue"/>
</shape>
Code for the other button
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/colorPink"/>
</shape>
Can we add the both codes in to a single xml file in the drawable folder or should we need to create two separate xml files?
Solution
You should create separate xml files.
Because they are referenced by their file names when you use them.
Unlike string
resources which are referenced by id's
Answered By - Nongthonbam Tonthoi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.