Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/mainLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.android.myApp.MainActivity" >
- </RelativeLayout>
- mLayout = (RelativeLayout) findViewById(R.id.mainLayout);
- RelativeLayout.LayoutParams lprams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
- RelativeLayout.LayoutParams.WRAP_CONTENT);
- Button btnTag = new Button(this);
- btnTag.setText("Button0");
- btnTag.setId(0);
- btnTag.setOnClickListener(mGlobalOnCLickListener);
- mLayout.addView(btnTag, lprams);
- lprams.addRule(RelativeLayout.BELOW, 0);
- btnTag = new Button(this);
- btnTag.setText("Button2");
- btnTag.setId(1);
- btnTag.setOnClickListener(mGlobalOnCLickListener);
- mLayout.addView(btnTag, lprams);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement