Reputation: 575
this is my code for text view which space from left but i want to left allign text how i do that? how much name is long its align from right
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="#000000"
android:orientation="vertical" >
<TextView
android:id="@+id/lblUnabletoProceed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="150dip"
android:textColor="#FFCC00"
android:text="" />
Upvotes: 0
Views: 73
Reputation: 6444
use android:gravity="right"
or android:layout_gravity="right"
in linearLayout and its better to use Relativelayout. In relative Layout use android:layout_alignParentRight="true"
, for a margin android:layout_marginRight="5dp"
Upvotes: 1
Reputation: 20587
Use for align
android:gravity="right"
and use for margin/padding
android:paddingRight=16dip
this will give you alignment to the right and spacing.
Upvotes: 0
Reputation: 157467
<TextView
android:id="@+id/lblUnabletoProceed"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="150dip"
android:textColor="#FFCC00"
android:gravity="right"
android:paddingRight="8dip"
android:text="" />
Upvotes: 0