101k views
3 votes
In a linear layout, which attribute can you add to switch to horizontal orientation?

a. android:weight="horizontal"
b. android:orientation="horizontal"
c. android:gravity="horizontal"
d. android:layout="horizontal"

User Serup
by
8.1k points

1 Answer

4 votes

Final answer:

In Android development, the attribute to change a linear layout to horizontal orientation is 'android:orientation="horizontal"'.

Step-by-step explanation:

The attribute you can add to switch a linear layout to horizontal orientation in Android development is b. android:orientation="horizontal". The android:orientation attribute specifies the orientation of a LinearLayout. The default orientation is vertical. By setting this attribute to "horizontal", the layout will arrange its children in a row, side by side. Neither android:weight nor android:gravity nor android:layout can change the orientation of the linear layout to horizontal.

User Shalmanese
by
8.3k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.