Error: Error: Invalid integer types (in 'layout_height' with value '10')

<TextView android:id="@+id/textView1" android:layout_width="match_parent" android:layout_height="10" android:layout_alignBottom="@+id/editText2" android:layout_alignRight="@+id/editText2" android:layout_alignEnd="@+id/editText2" android:layout_marginBottom="63dp" android:text="@string/hello" /> 

Every time I enter text without a line, it gives me a yellow I. Therefore, I made a line. Now I get the message above in layout_height. I am new to Android development.

+6
source share
2 answers

Use either dp or sp to specify with integer values

  android:layout_height="10dp" 

or

  android:layout_height="35sp" 
+10
source

u should indicate the heght value in dp.

height and weight values ​​are based on units. u can not just add an integer.

 android:layout_height="10dp" 

check these lnks too

What is the difference between "px", "dp", "dip" and "sp" on Android?

http://developer.android.com/guide/topics/resources/more-resources.html#Dimension

What is the difference between fill_parent and wrap_content?

+4
source

Source: https://habr.com/ru/post/980652/


All Articles