Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set LinearLayout HORIZONTAL using C# Xamarin

Im trying to align controls in my Android App.

I need to do this but using CODE / C# / Xamarin This: android:orientation="horizontaly"

This following code doesnt work in Xamarin (i guess good in java??): .setOrientation(LinearLayout.HORIZONTAL);

The accepted Method is : .Orientation My code with missing/wrong code: see * below

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;

How do I set this value: ??? LinearLayout.HORIZONTAL; ????

Thank you Martin

like image 777
Louis Martin Avatar asked Feb 15 '23 00:02

Louis Martin


1 Answers

Try this:

LLMain.Orientation = Orientation.Horizontal;
like image 99
Roman Kagan Avatar answered Feb 23 '23 03:02

Roman Kagan