Android UI gravity=“right” doesnt work

IWannaWin

New Member
Im trying to build a UI screen.here is the main.xml\[code\]<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/LinearLayout1"android:layout_width="fill_parent"android:layout_height="fill_parent"android:gravity="bottom"android:orientation="vertical" ><LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.33" android:orientation="horizontal" > <ImageView android:id="@+id/kartoMap" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:layout_gravity="left" android:src="http://stackoverflow.com/questions/11074290/@drawable/ic_launcher" /> <VideoView android:id="@+id/robotVideo" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="right" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.66" android:orientation="horizontal" > <LinearLayout android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="0.2" android:orientation="vertical" > <ToggleButton android:id="@+id/stepsBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:layout_weight="1" android:text="Steps" android:textOff="STEPS" android:textOn="STEPS" /> <Button android:id="@+id/ArmsBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Arms HOLDER" /> </LinearLayout> <FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:id="@+id/joystickRight" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:src="http://stackoverflow.com/questions/11074290/@drawable/joystick" /> <ImageView android:id="@+id/innerCircle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="http://stackoverflow.com/questions/11074290/@drawable/inner_circle" /> </FrameLayout> </LinearLayout> </LinearLayout>\[/code\]The problem is in the ImageView called 'joystickRight'.I want it to be tied to the right side of the screen, but instead - the frameLayout and the linearLayout are divided in the lower screen and the imageView stays in the center of the frameLayout. Why??
 
Back
Top