<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" > <TextViewAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:background= "#00FF00"Android:text= "First TextView"/> <TextViewAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:background= "#FF0000"Android:text= "Second TextView"/></LinearLayout>
Packagecom.njulya.firstprj;ImportAndroid.os.Bundle;Importandroid.app.Activity;ImportAndroid.view.Menu; Public classMainactivityextendsActivity {@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (r.layout. First_layout); } @Override Public BooleanOncreateoptionsmenu (Menu menu) {//inflate the menu; This adds items to the action bar if it is present.getmenuinflater (). Inflate (R.menu.main, menu); return true; }}
Familiar with ANDROIDAPI series 1--linearlayout