Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is orientation constants for views?

<View
    android:layout_width="match_parent"
    android:layout_height="12dp"
    android:orientation="horizontal" />

What is android:orientation="horizontal" in the above xml?

The Android-Studio quick tip shows it is orientation constant, which is not very helpful.

like image 850
q126y Avatar asked Jul 15 '16 03:07

q126y


2 Answers

there is no use for orientation attribute in View, orientation is only required for Linear layout or other parent layouts

like image 23
Uma Achanta Avatar answered Nov 15 '22 01:11

Uma Achanta


android:orientation is only relevant in a ViewGroup where its children are organized consecutively such as a LinearLayout, so in your case it's absolutely useless.

like image 142
John Sardinha Avatar answered Nov 15 '22 01:11

John Sardinha