EditText:如何将clipToPadding设置为false

时间:2017-09-01 17:00:03

标签: android android-layout android-edittext android-view textview

我有一个带有填充的可滚动EdiText,但是如您所知,当您在EditText中滚动文本时,它会被填充剪掉而不是重叠。

EditText没有clipToPadding选项。有没有办法模仿clipToPadding =" false" ViewGroup中提供的功能?

1 个答案:

答案 0 :(得分:0)

This is a bit hacky, but you can add a transparent shadow with a shadow radius equal to the bottom padding.

e.g.

editText.setShadowLayer(editText.extendedPaddingBottom.toFloat(), 0f, 0f, Color.TRANSPARENT)
相关问题