Error in XML layout, Unable to convert to size: 15

In my application, I have an error in the graphic layout that displays as:

error! UnsupportedOperationException: Can't convert to dimension: 15 Exception details are logged in Window > Show View > Error LogThe following classes could not be found: - TextView 

When I run the application, it works, but it shows an error in the graphic layout, does anyone know the reason for this.

This happens when I put android:layout_marginTop="-3dip" , if I do not use - then this is not displayed.

thank

+4
android android-layout
Mar 14 2018-11-11T00: 00Z
source share
2 answers

There is no such thing as a negative supply. Use android:gravity="top" if your text image is larger than the text and you want the text to appear on top. Otherwise use android:layout_height="wrap_content" . Your presentation will exactly follow this path.

If you need 3dp space between the top border of the textview and the actual text, use android:paddingTop="3dp" . As a rule, the field is free space outside the view, the complement is the internal distance between the border and the content.

+3
Mar 14 2018-11-11T00:
source share

I doubt that you still need help solving this problem; however, I came across a similar message and thought I wanted to share with others who might encounter this error message.

I found that the error was only encountered in the 2.7M QVGA slider device configuration. I also found that if I changed the negative value to a different number, I no longer received the error message.

So, I ended up using -2.

I'm going to guess that the error is caused by some scaling calculations in the graphics renderer. But it is not worth exploring to find out at this moment.

+3
May 16 '11 at 20:22
source share



All Articles