layout_width /2 in android studio code example
Example: android with vs layout_width
android:width is for setting an exact number of pixels. android:layout_width can be a dimension, as above, or it can be one of fill_parent , match_parent , or wrap_content . It is an error to use something other than a dimension for android:width .