android:layout_marginRight?

by Mariano Kamp » Thu, 18 Mar 2010 03:12:42 GMT


Sponsored Links
 Hi,

  I have a small text view (see below) that should span the complete width,
except for a margin left and right. No matter what I specify for
marginRight, it always gets added to the left side, i.e. the margin left
grows and the text view is flush to the right side though.

  Am I doing something wrong here?

Cheers,
Mariano

<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=" http://schemas.android.com/apk/res/android" ;
android:id="@+id/status_text"
 android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
 android:layout_marginLeft="3dp"
android:layout_marginRight="13dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"

android:textColor="#fff"
android:gravity="center"
android:background="@drawable/status_background"

android:visibility="gone"/>

--



android:layout_marginRight?

by Romain Guy » Thu, 18 Mar 2010 03:43:20 GMT


 Why are you using width=fill_parent and gravity=center_horizontal? It
doesn't make sense.



>


Sponsored Links


android:layout_marginRight?

by Mariano Kamp » Thu, 18 Mar 2010 05:05:01 GMT


 You're right. Thanks. It works now.

<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=" http://schemas.android.com/apk/res/android" ;
android:id="@+id/status_text"
 android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
 android:layout_margin="3dp"

android:textColor="#fff"
android:background="@drawable/status_background"

android:visibility="gone"/>





> >



Other Threads

1. Will data remain after updating android os in mobile phones



Yes.


No.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6
Available!

-- 

2. ics

SUHU AH

nama Jefri Priambodo
Tlp    08121153374


-- 
@JP
~from pc~

-- 
"Indonesian Android Community [id-android]" 

3. How to force system built my own library earlier

4. Re[4]: WTI : Nexian

5. Re[2]: WTI : Nexian

6. MapController.setCenter misbehaving

7. why does AlarmManagerService.java call "remove" first in a "set" alarm?