Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create the layout to be placed inside the ScrollView
- LinearLayout layout = new LinearLayout(mActivity);
- // Makes each object stack vertically instead of horizontally
- layout.setOrientation(LinearLayout.VERTICAL);
- // Create actual images/text to display
- ImageView iv = new ImageView(mActivity);
- iv.setImageBitmap(monsterBitmap);
- TextView tv = new TextView(mActivity);
- tv.setText(credits);
- // Add images/text to LinearLayout
- layout.addView(iv);
- layout.addView(tv);
- // Create the ScrollView and set the scrollable area size
- ScrollView about = new ScrollView(mActivity);
- about.setLayoutParams(new ViewGroup.LayoutParams(320, 430));
- // Add LinearLayout to the ScrollView
- about.addView(layout);
- // Get reference to the FrameLayout and add the ScrollView
- FrameLayout fl = (FrameLayout)mActivity.findViewById(R.id.framelayout);
- fl.addView(about);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement