순서 없이 그냥 막 넣어 놨씁니다.
필요한 것들만 쓰면 됨.
        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);
Posted by 예배하는 프로그래머
  
        LinearLayout layout = new LinearLayout(getApplicationContext());// 리니어 레이아웃(뼈대 1)
        layout.setOrientation(LinearLayout.VERTICAL);
     
        // 리니어 레이아웃 자식붙이기 (뼈대2)
        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(
                98,45); // 버튼 크기
       
        //버튼의 위치
        layoutParams3.gravity = Gravity.LEFT;
        layoutParams3.topMargin = 13;
        layoutParams3.leftMargin = 10;
           
        // 버튼 클릭 이벤트
        homeButton.setOnClickListener(new OnClickListener() {
           
            @Override
            public void onClick(View v) {
                finish();
            }
        });
       
        // 프래임에 버튼 추가해주기
        layFrame.addView(homeButton,layoutParams3);
       
        // 레이아웃 크기 지정
        layout.addView(layFrame,new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FILL_PARENT,
                70));
       
        layout.addView(mGallery, layoutParams);
      
        // 노출시키기
        setContentView(layout);
Posted by 예배하는 프로그래머
  

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/framelayout"
    >
  <ProgressBar android:id="@+android:id/progresssmall"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|center_horizontal" />
       
  <coverflow.CoverFlow
  android:id="@+id/coverflow"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  />
     <TextView
        android:id="@+id/titleTxt"
        android:layout_height="60px"
        android:text=''
        android:layout_marginBottom="20dip"  
        android:gravity="center"    
        android:layout_gravity="bottom"
        android:textStyle="bold" android:layout_width="fill_parent"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textSize="19px" android:background="@drawable/bg_intro_tit"
        android:lines="1" android:duplicateParentState="true"
  android:textColor="#FFFFFF"/>
  <TextView
        android:id="@+id/sumTxt"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"  
        android:layout_marginBottom="8dip"     
        android:textSize="14px"
        android:paddingLeft="10dip"
        android:textColor="#888888" android:lines="2"
  android:duplicateParentState="false"  android:layout_width="fill_parent"/>
  <TextView
        android:id="@+id/dateTxt"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:text=""
        android:textSize="12px"
        android:paddingLeft="10dip"
        android:textColor="#9A4B24" android:lines="1"
  android:duplicateParentState="false"  android:layout_width="fill_parent"/>
  
 
    </FrameLayout>
   
 

'개발도구 > 안드로이드' 카테고리의 다른 글

LinearLayout RelativeLayout 다른 정렬방법  (0) 2011.05.17
이미지 와 이미지 사이 간격 없애기  (0) 2011.05.17
Layout 고급  (0) 2011.05.17
AbsoulteLayout  (0) 2011.05.17
TableLayout  (0) 2011.05.17
RelativeLayout  (0) 2011.05.17
Posted by 예배하는 프로그래머