
Can you explain please why it isn’t changing when I change gravity. First when I changed it position of button was changed but now I can’t change position.
main.XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="92dp"
android:layout_height="0dp"
android:layout_gravity="right"
android:layout_weight="1"
android:text="@string/button1" />
</LinearLayout>
set this property for related layout android:layout_width=”match_parent” for LinearLayout
(parent Layout)