Error in xml layout, Can't convert to dimension: 15

前端 未结 2 1552
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 20:55

Within my application I have an error in the graphical layout which shows up as:

error!
UnsupportedOperationException: Can\'t convert to dimension: 15
Except         


        
2条回答
  •  生来不讨喜
    2020-12-06 21:28

    There is no such thing as a negative margin. Use android:gravity="top" if your textview is higher than your textsize and you want the text to appear on the top. Otherwise use android:layout_height="wrap_content". Your view will exactly fit this way.

    If you want 3dp space between the top border of the textview and the actual text, use android:paddingTop="3dp". Generally, margin is the free space outside the view, padding is the inside spacing between the border and the content.

提交回复
热议问题