android - How do I put a button A under button B such that the left side of A is vertically aligned with the center of B? -
how position button starts vertically aligned middle of button above it? size of upper button may vary screen screen.
thanks in advance,
is need?
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal" android:orientation="vertical"> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="first button"/> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="2" android:orientation="horizontal"> <button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:visibility="invisible"/> <button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="second"/> </linearlayout> </linearlayout>
Comments
Post a Comment