What is wrong in this xml ? the two textviews don't seem to occupy same space
<LinearLayout
android:id="@+id/detail_address" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:padding="10px"
android:layout_weight="1">
<TextView android:id="@+id/address" android:text="Address:"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:textColor="@color/fontonbg"
android:gravity="right" android:layout_weight="1" />
<TextView android:id="@+id/address_details"
android:text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/bigfontonbg" android:textStyle="bold"
android:textSize="16sp" android:layout_toLeftOf="@+id/address_btn"
android:layout_marginLeft="10px" android:gravity="left"
android:layout_weight="1" android:layout_gravity="center_vertical" />
<ImageView android:id="@+id/address_btn" android:src="@drawable/button"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="10px" />
</LinearLayout>
android:layout_width="wrap_content"
This statment tells Android that the view wants to be just large enough to fit its own internal content, taking its own padding into account. This means that the width will depend on the length of the text on this TextView
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With