How to right align widget in horizontal linear layout Android?

This is the code I am using and it is not working: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”horizontal”> <TextView android:text=”TextView” android:id=”@+id/textView1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:gravity=”right”> </TextView> </LinearLayout> 20 Answers 20

How to align 3 divs (left/center/right) inside another div?

I want to have 3 divs aligned inside a container div, something like this: [[LEFT] [CENTER] [RIGHT]] Container div is 100% wide (no set width), and center div should remain in center after resizing the container. So I set: #container{width:100%;} #left{float:left;width:100px;} #right{float:right;width:100px;} #center{margin:0 auto;width:100px;} But it becomes: [[LEFT] [CENTER] ] [RIGHT] Any tips? 20 Answers … Read more