android - I need to generate a custom drawable view as mentioned -


enter image description here

i stuck generating custom drawable of above type.i able make cicular selector button shown in in red , green border. unable make other drawable includes these 2 buttons in grey color , dark grey color border. , don't understand how place circular buttons @ right positions.

you can try doing this, give desired result.

<?xml version="1.0" encoding="utf-8"?> <!-- view hold background --> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@drawable/temp"     android:orientation="horizontal">      <!--takes 50%-->     <framelayout         android:layout_width="0dp"         android:layout_height="match_parent"         android:layout_weight="50">          <button             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center"             android:text="left" />     </framelayout>      <!-- width of view should width of center portion(excluding cirlces)-->     <!-- have taken 60 after measuring.-->     <view         android:layout_width="60dp"         android:layout_height="match_parent" />     <!--takes 50%-->     <framelayout         android:layout_width="0dp"         android:layout_height="match_parent"         android:layout_weight="50">          <button             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center"             android:text="right" />     </framelayout> </linearlayout> 

what have done simple. put image in background, divide area in two, used weights.

p:s temp background file.

result :

**result :**


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -