2021年1月1日星期五

Text clipped by padding in big outlined TextInputLayout

One of my apps contains some kind of "notes field", which is a big textinputlayout containing a potentially big text. I'm using this piece of layout (i removed some less relevant attributes):

    <com.google.android.material.textfield.TextInputLayout          style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"          android:layout_width="0dp"          android:layout_height="wrap_content"          android:layout_marginVertical="@dimen/activity_vertical_margin"          android:clipChildren="false">            <com.google.android.material.textfield.TextInputEditText              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:gravity="top|start"              android:maxHeight="@dimen/notes_maximum_height"              android:minHeight="@dimen/notes_minimum_height"              android:inputType="textMultiLine|textCapSentences"              android:paddingHorizontal="0dp"              android:paddingVertical="8dp" />        </com.google.android.material.textfield.TextInputLayout>  

I would like a vertical padding, so that the cursor and the first line don't "touch" the outline, and that's ok. The problem is, when the content reaches its maximum height and starts scrolling, i can see the text clipped by the padding and not touching the upper and lower part of the outline. So i tried with clipChildren set to false as i often do, but i had no luck. Same behavior. After a lot of failed attempts, i'm really wondering if this is even possible!

The problem mentioned

https://stackoverflow.com/questions/65535168/text-clipped-by-padding-in-big-outlined-textinputlayout January 02, 2021 at 09:04AM

没有评论:

发表评论