Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use of setOrientation method on a LinearList object

The setOrientation method of LinearLayout will not accept the argument VERTICAL, contrary to the following from the android reference

public void setOrientation (int orientation) Since: API Level 1 Should the layout be a column or a row. Related XML Attributes * android:orientation Parameters orientation Pass HORIZONTAL or VERTICAL. Default value is HORIZONTAL.

I have tried, unsuccessfully, using import android.widget.LinearLayout.*

By hacking around I was able to find that 1 is vertical, which works fine, but this is a bug that should be fixed.

like image 823
peter gottlieb Avatar asked Mar 15 '11 01:03

peter gottlieb


2 Answers

LinearLayout myLayout = new LinearLayout(this);
myLayout.setOrientation(LinearLayout.VERTICAL);
like image 127
Jake Wilson Avatar answered Oct 16 '22 15:10

Jake Wilson


The setOrientation method of LinearLayout will not accept the argument VERTICAL

Yes, it does. Here is a sample project that has worked for about three years, certainly on every shipping version of Android.

By hacking around I was able to find that 1 is vertical, which works fine, but this is a bug that should be fixed.

The bug is in your code.

like image 42
CommonsWare Avatar answered Oct 16 '22 14:10

CommonsWare