android - I need to generate a custom drawable view as mentioned -
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 :


Comments
Post a Comment