Search code examples
androidandroid-layoutandroid-drawable

Can we actually create 2 drawableLeft in android?


I was wondering if there is a way using which we can create 2 drawableLeft in our android layout. I have a scenario where i need to use 2 drawables. Anyone with any suggestions, drop them down please.

Edit: This is the layout that i want to design.

layout


Solution

  • If you are using this view in only one place then you could just use LinearLayout with horizontal layout. and place 1 ImageView, TextView or Spinner [as per your requirement if the country code is selectable then you should use spinner instead of TextView for country code view] TextView and style them as needed. As in following picture:

    enter image description here

    If you need to use this layout in multiple place you could implement Custom View with the same layout file. Check how to create Custom View from this answer.