Reputation: 6521
How would I make the TextView_height=content_height+padding
When I am adding some top-padding to the textbox - it moves the content behind the borders of the TextView.
This is right, since I made the TextView to be as tall as the content.
Is it possible to make the TextView as tall as content + padding?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
tools:context=".DisplayActivity" >
<TextView
android:id="@+id/TopmessageStripe"
style="@style/TopmessageStripeTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignWithParentIfMissing="false"
android:layout_centerHorizontal="true"
android:height="@dimen/big_margin"
android:paddingTop="5dp"
android:text="TextView" />
</RelativeLayout>
Upvotes: 0
Views: 132
Reputation: 499
This is most likely your problem
android:height="@dimen/big_margin"
It is setting a custom height instead of wrapping the content.
Upvotes: 2
Reputation: 961
Not sure how to do it using the gui but this might be what you're looking for in the xml for the text view
<TextView
android:id="@+id/mTextView"
android:paddingTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
Upvotes: 0