순서 없이 그냥 막 넣어 놨씁니다.
필요한 것들만 쓰면 됨.
LinearLayout layout = new LinearLayout(getApplicationContext());
layout.setOrientation(LinearLayout.VERTICAL);
layout.setBackgroundColor(Color.WHITE);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.FILL_PARENT);
layoutParams.setMargins(0,0,0,0);
layoutParams.weight = 1.0f;
mGallery.setIsGalleryCircular(false);
FrameLayout layFrame = new FrameLayout(getApplicationContext());
layFrame.setBackgroundResource(R.drawable.top_logo);
ImageButton homeButton = new ImageButton(getApplicationContext());
homeButton.setBackgroundResource(R.drawable.btn_category_mainnews_off);
FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(
93,45);
필요한 것들만 쓰면 됨.
LinearLayout layout = new LinearLayout(getApplicationContext());
layout.setOrientation(LinearLayout.VERTICAL);
layout.setBackgroundColor(Color.WHITE);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.FILL_PARENT);
layoutParams.setMargins(0,0,0,0);
layoutParams.weight = 1.0f;
mGallery.setIsGalleryCircular(false);
FrameLayout layFrame = new FrameLayout(getApplicationContext());
layFrame.setBackgroundResource(R.drawable.top_logo);
ImageButton homeButton = new ImageButton(getApplicationContext());
homeButton.setBackgroundResource(R.drawable.btn_category_mainnews_off);
FrameLayout.LayoutParams layoutParams3 = new FrameLayout.LayoutParams(
93,45);
layoutParams3.gravity = Gravity.LEFT;
layoutParams3.topMargin = 13;
layoutParams3.leftMargin = 10;
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(30, 20, 20, 20);
contentView = new TextView(getApplicationContext());
contentView.setTextColor(Color.rgb(51,51,51));
contentView.setTextSize(defaltSize);
imageView = new ImageView(getApplicationContext());
ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.test01);
iv.setAdjustViewBounds(true);
iv.setLayoutParams(new Gallery.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
iv.setScaleType(ImageView.ScaleType.FIT_XY); // 레이아웃 크기에 이미지를 맞춘다
mLinearLayout.addView(iv);
setContentView(mLinearLayout);
layoutParams3.topMargin = 13;
layoutParams3.leftMargin = 10;
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(30, 20, 20, 20);
contentView = new TextView(getApplicationContext());
contentView.setTextColor(Color.rgb(51,51,51));
contentView.setTextSize(defaltSize);
imageView = new ImageView(getApplicationContext());
ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.test01);
iv.setAdjustViewBounds(true);
iv.setLayoutParams(new Gallery.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
iv.setScaleType(ImageView.ScaleType.FIT_XY); // 레이아웃 크기에 이미지를 맞춘다
mLinearLayout.addView(iv);
setContentView(mLinearLayout);
'개발도구 > aOS - 안드로이드 개발' 카테고리의 다른 글
[안드로이드] TextView 의 설정 (0) | 2011.05.30 |
---|---|
[안드로이드] GridView 활용 (0) | 2011.05.30 |
[안드로이드] HTML 문서 보일때 <BR> 처리 (0) | 2011.05.27 |
[안드로이드] 버튼 클릭시 스피너 사용하기 - 다이어로그! (0) | 2011.05.27 |
[안드로이드] EXCEPTION: main - Unable to start activity ComponentInfo (0) | 2011.05.27 |