如何使用C# Xamarin设置LinearLayout为水平布局

4

我正在尝试在我的Android应用程序中对控件进行对齐。

我需要使用CODE / C# / Xamarin来完成这个操作: 这个:android:orientation="horizontaly"

以下代码在Xamarin中无法正常工作(我猜在Java中可以?): .setOrientation(LinearLayout.HORIZONTAL);

被接受的方法是:.Orientation 我的代码存在缺失/错误的代码:请参见下面的*

LinearLayout LLMain = new LinearLayout(this);
LLMain.Id = _intID;       
LLMain.AddView(textView(_intID));
LLMain.AddView(editText(_intID));
LLMain.Orientation = LinearLayout.HORIZONTAL; ***
linearlayoutList.Add(LLMain);
return LLMain;

如何设置这个值: ??? LinearLayout.HORIZONTAL; ????
谢谢 马丁
1个回答

8

试试这个:

LLMain.Orientation = Orientation.Horizontal;

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接