LinearLayout layout = new LinearLayout(this); Button button1 = new Button(this); Button button2 = new Button(this); layout.AddView(button1); layout.AddView(button2); button1.RequestFocus();
In this example, a LinearLayout is defined in an XML layout file with two child views: a button and an edit text. The orientation of the linear layout is set to horizontal. The RequestFocus method could be called programmatically on either the button or the edit text to highlight it on the screen. Package/Library: Android.Views