Click here to Skip to main content
15,867,834 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
sry just a basic question...
im new in java and eclipse ide somehow....my question is how to reposition the buttons that i added on the screen...for example i just added 3 buttons and i want to reposition them...i reposition the 1st button and put it in the bottom of the screen and once i want to change the other button's position another buttons move either...i using layout margin (top, left, right and bottom) option for change the position...can anybody helppp? :(
Posted
Comments
maulikdesai 6-Oct-14 3:47am    
can you attach button position code
Sepehr Mahmoudi 6-Oct-14 12:33pm    
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<Button
android:id="@+id/button3"
android:layout_width="78dp"
android:layout_height="wrap_content"
android:text="Enter" android:layout_marginLeft="145dp" android:layout_marginTop="490dp"/>

<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Previous" android:layout_marginTop="-50dp"/>


<Button
android:id="@+id/button1"
android:layout_width="78dp"
android:layout_height="wrap_content"
android:layout_marginLeft="280dp"
android:text=" Next " android:layout_marginTop="-50dp"/>

</LinearLayout>
Sepehr Mahmoudi 6-Oct-14 12:34pm    
this code is correct right now...and all 3 button in a same line like thw way i want...but once i change the top layout margin of button3 the other buttons move either...whats the problem?

1 solution

Take a look at Android UI Layouts and Controls[^] for an excellent tutorial on UI layouts.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900