开发者

use of setOrientation method on a LinearList object

开发者 https://www.devze.com 2023-02-16 16:52 出处:网络
The setOrientation method of LinearLayout will not accept the argument VERTICAL, contrary to the following from the android reference

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开发者_JAVA百科 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.


LinearLayout myLayout = new LinearLayout(this);
myLayout.setOrientation(LinearLayout.VERTICAL);


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消