2013-05-02 3 views
3

화면 레이아웃을 모든 화면 크기에 맞게 크기 조정 Android에 만들 수 있습니까?Android 용 탄성/액체 레이아웃 화면 하나 생성

현재 중소형, 대형, xlarge 등 다양한 레이아웃을 가지고 놀고 있습니다.하지만 꼭 필요한 모든 레이아웃은 크기가 맞는 단일 레이아웃입니다.

예 : 백분율 기반 레이아웃.

내가 만드는 앱은 공간을 더 많이 사용하는 측면에서 대형 화면을 특별히 활용할 필요가 없습니다.

홈 화면은 이미지 2 개, 버튼 묶음, 하단에 광고 등으로 구성되어 있으며 광고 크기는 화면 하단의 크기에 따라 그 밖의 모든 항목의 크기가 커지기를 원합니다.

아주 단순한 인터페이스로 4 가지 레이아웃을 생산해야하는 것은 너무 복잡합니다.

많은 감사드립니다.

+0

http://developer.android.com/guide/practices/screens_support.html 같은 무게로 RelativeLayout

또는

레이아웃을 사용할 수 있습니다. 나는 그것이 가능하다고 생각하지 않는다. – Raghunandan

+0

친절하게 레이아웃 스크린 샷을 추가하여 레이아웃을 도울 수있다. –

+0

다음은 사용하려는 레이아웃의 모형입니다. http://www.pixelkicks.co.uk/_download/Sample-Android-Layout.jpg – pixelkicks

답변

1

당신은

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" > 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="2" 
      android:scaleType="fitXY" 
      android:src="@drawable/ic_launcher" /> 

     <ImageView 
      android:id="@+id/imageView2" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="2" 
      android:scaleType="fitXY" 
      android:src="@drawable/ic_launcher" /> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" > 

      <Button 
       android:id="@+id/button1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button" /> 

      <Button 
       android:id="@+id/button2" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button" /> 

      <Button 
       android:id="@+id/button3" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Button" /> 
     </LinearLayout> 
    </LinearLayout> 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="match_parent" 
     android:layout_height="70dp" 
     android:gravity="center" 
     android:text="ADV" /> 

</LinearLayout>