android - Design a round button over two colored layouts -
i'm trying design :
currently i'm having issue putting button @ "the middle" of 2 layouts reunion point. there way ?
thanks.
here way it
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightsum="1"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0.5" android:background="#ff0000"> <!-- add content here --> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0.5" android:background="#ffff00" android:weightsum="0.5"> <!-- add content here --> </linearlayout> </linearlayout> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerinparent="true" android:background="#000000" android:text="test" android:textcolor="#ffffff"/> </relativelayout>
output:
you can change layout height android:layout_weight="0.5"
Comments
Post a Comment