Im beginner in android development. I ve just created a button in main.xml file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:text="Click"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
I just give integer value for android: but I got error
error: Error: Integer types not allowed
How can give fixed width and height for Button here?
and
What is the main difference between android:layout_width and android:Width?
Thanks.
To create a button with fixed height and width, you can give values in both px or in dp.
giving values in dp is more convenient , bec android automatically scale the height and width in ldpi,mdpi and hdpi devices.
What is the difference between android:layout_width and android:width