Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:tools="http://schemas.android.com/tools"
  3. android:id="@+id/mainLayout"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:paddingBottom="@dimen/activity_vertical_margin"
  7. android:paddingLeft="@dimen/activity_horizontal_margin"
  8. android:paddingRight="@dimen/activity_horizontal_margin"
  9. android:paddingTop="@dimen/activity_vertical_margin"
  10. tools:context="com.android.myApp.MainActivity" >
  11.  
  12. </RelativeLayout>
  13.  
  14. mLayout = (RelativeLayout) findViewById(R.id.mainLayout);
  15. RelativeLayout.LayoutParams lprams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
  16. RelativeLayout.LayoutParams.WRAP_CONTENT);
  17.  
  18. Button btnTag = new Button(this);
  19. btnTag.setText("Button0");
  20. btnTag.setId(0);
  21. btnTag.setOnClickListener(mGlobalOnCLickListener);
  22. mLayout.addView(btnTag, lprams);
  23. lprams.addRule(RelativeLayout.BELOW, 0);
  24.  
  25. btnTag = new Button(this);
  26. btnTag.setText("Button2");
  27. btnTag.setId(1);
  28. btnTag.setOnClickListener(mGlobalOnCLickListener);
  29. mLayout.addView(btnTag, lprams);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement