代码之家  ›  专栏  ›  技术社区  ›  RobGThai

如何在Eclipse模拟器中创建代表三星Galaxy S的AVD?

  •  4
  • RobGThai  · 技术社区  · 16 年前

    我正在为三星Galaxy S开发一个应用程序(我不是这里的决策者),他们希望它的布局精确到像素。 我能用普通的2.1 AVD吗?

    所以我尝试创建wqvga432,但它看起来像这样。我不知道为什么线性布局不能填满屏幕,而只能使用韩文的大图像(我不能缩小比例,但这是不同的问题)。

    这是main.xml:。

    < Buff行情>

    <relativelayout
    android:id=“@+id/ui_导航栏”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:background=“ff333333”
    
    &!--这是页面顶部的导航面板-->
    &!--左上角按钮,又名后退按钮-->
    <framelayout安卓:id=“@+id/ui_TopLeftBox”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_AlignParentLeft=“真”
    android:layout_centervertical=“true”>
    </framelayout>
    < /代码> 
    < /块引用>
    
    
    <!--屏幕名称-->
    <framelayout android:id=“@+id/ui_TopBox”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_centerhorizontal=“真”
    android:layout_centervertical=“true”>
    </framelayout>
    
    &!--右上角按钮,又称前进按钮-->
    <framelayout安卓:id=“@+id/ui_TopRightBox”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_AlignParentRight=“真”
    android:layout_centervertical=“true”>
    </framelayout>
    </relativelayout>
    FrAMLALayOUT
    安卓:id=“@+id/ui_contentview”
    android:layout_width=“填充父级”
    android:layout_height=“0dip”
    安卓:paddingtop=“0px”
    android:layout_weight=“1”>
    
    &!--主视图-->
    <相对布局
    安卓:id=“@+id/mainview”
    android:layout_width=“填充父级”
    android:layout_height=“fill_parent”>
    <相对布局
    android:id=“@+id/topbanner”
    android:orientation=“水平”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:layout_AlignParentTop=“真”
    android:background=“ffffcc00”
    gt;
    <textView安卓:textsize=“20sp”
    android:textcolor=“ff000000”
    android:text=“欧元/美元”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_AlignParentLeft=“真”
    android:layout_centervertical=“真”
    /gt;
    </relativelayout>
    <相对布局
    android:id=“@+id/view1”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:layout_below=“@+id/topbanner”
    android:background=“ff444444”>
    <复选框android:id=“@+id/cbx1”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_centervertical=“真”
    android:layout_AlignParentLeft=“真”
    /gt;
    <com.vg.library.numericinput(lt;com.vg.library.numericinput)
    安卓:id=“@+id/val1nip”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_centervertical=“真”
    android:layout ou torightof=“@+id/cbx1”
    /gt;
    </relativelayout>
    <com.vg.library.numericinput(lt;com.vg.library.numericinput)
    安卓:id=“@+id/val2nip”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_below=“@+id/view1”/>
    <textView android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:text=“屏幕01”
    android:layout_below=“@+id/val2nip”
    android:layout_AlignParentLeft=“真”/>
    </relativelayout>
    </framelayout>
    
    &!--扩展条-->
    <相对布局
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:layout_AlignParentBottom=“真”
    gt;
    图像浏览
    android:id=“@+id/ui_扩展条”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:src=“@drawable/bar”
    android:background=“0000”
    /gt;
    FrAMLALayOUT
    android:id=“@+id/ui_drawerview”
    android:visibility=“消失”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    安卓:paddingtop=“0px”
    android:layout_weight=“1”
    android:layout_below=“@+id/ui_expandbar”>
    <相对布局
    android:id=“@+id/ui_drawerContent”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:background=“ff550000”>
    <相对布局
    安卓:id=“@+id/m1”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:background=“ff550000”>
    <复选框android:id=“@+id/cbxb”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_centervertical=“真”
    android:layout_AlignParentLeft=“真”
    /gt;
    <com.vg.library.numericinput(lt;com.vg.library.numericinput)
    安卓:id=“@+id/valbnip”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_centervertical=“真”
    android:layout\torightof=“@+id/cbxb”
    /gt;
    </relativelayout>
    </relativelayout>
    </framelayout>
    </relativelayout>
    <相对布局
    android:orientation=“水平”
    android:layout_width=“填充父级”
    android:layout_height=“包装内容”
    android:background=“ff333333”
    android:layout_weight=“0”
    android:layout_gravity=“底部”
    gt;
    &!--这是页面底部的菜单面板-->
    <com.vg.library.menubar(lt;com.vg.library.menubar)
    android:id=“@+id/ui_菜单栏”
    android:orientation=“水平”
    android:layout_width=“包装内容”
    android:layout_height=“包装内容”
    android:layout_centerhorizontal=“真”
    android:layout_centervertical=“真”
    android:background=“ffaaaa00”
    gt;
    &!--所有菜单项都应位于此处-->
    </com.vg.library.menubar>
    </relativelayout>
    < /代码> 
    
    

    所以我尝试创建wqvga432,但它看起来像这样。我不知道为什么线性布局不能填满屏幕,而只能使用韩文的大图像(我不能缩小比例,但这是不同的问题)。

    WQVGA432

    这是main.xml:

    <RelativeLayout 
        android:id="@+id/ui_navBar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#FF333333"
    
        <!-- This is navigation panel at the top of the page -->
        <!-- Top-Left Button, aka Back button -->
        <FrameLayout android:id="@+id/ui_topLeftBox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true">
        </FrameLayout>
    
        <!-- Screen name -->
        <FrameLayout android:id="@+id/ui_topBox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true">
        </FrameLayout>
    
        <!-- Top-Right Button, aka Forward button -->
        <FrameLayout android:id="@+id/ui_topRightBox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true">
        </FrameLayout>
    </RelativeLayout>
    <FrameLayout
        android:id="@+id/ui_contentView"
        android:layout_width="fill_parent" 
        android:layout_height="0dip"
        android:paddingTop="0px" 
        android:layout_weight="1">
    
        <!-- Main View --> 
        <RelativeLayout
            android:id="@+id/mainView"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <RelativeLayout 
                android:id="@+id/topBanner"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:background="#FFFFCC00"
                >
                <TextView android:textSize="20sp" 
                    android:textColor="#FF000000"
                    android:text="EUR/USD"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_centerVertical="true"
                />
            </RelativeLayout>
            <RelativeLayout
                android:id="@+id/view1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/topBanner"
                android:background="#FF444444">
                <CheckBox android:id="@+id/cbx1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_alignParentLeft="true"
                />
                <com.vg.library.NumericInput 
                    android:id="@+id/val1Nip"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@+id/cbx1"
                     />
            </RelativeLayout>
            <com.vg.library.NumericInput 
                android:id="@+id/val2Nip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/view1" />
            <TextView android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:text="Screen01"
                android:layout_below="@+id/val2Nip"
                android:layout_alignParentLeft="true" />
        </RelativeLayout>
    </FrameLayout>
    
    <!-- ExpandBar -->
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        >
        <ImageView 
            android:id="@+id/ui_expandBar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/bar"
            android:background="#0000"
        />
        <FrameLayout
            android:id="@+id/ui_drawerView"
            android:visibility="gone"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:paddingTop="0px" 
            android:layout_weight="1"
            android:layout_below="@+id/ui_expandBar">
            <RelativeLayout
                android:id="@+id/ui_drawerContent"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="#FF550000" >
                <RelativeLayout
                android:id="@+id/m1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="#FF550000" >
                <CheckBox android:id="@+id/cbxB"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_alignParentLeft="true"
                />
                <com.vg.library.NumericInput 
                    android:id="@+id/valBNip"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@+id/cbxB"
                     />
                </RelativeLayout>
            </RelativeLayout>
        </FrameLayout>
    </RelativeLayout>
    <RelativeLayout 
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#FF333333"
        android:layout_weight="0"
        android:layout_gravity="bottom"
        >
        <!-- This is menu panel at the bottom of the page -->
        <com.vg.library.MenuBar 
            android:id="@+id/ui_menuBar"
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:background="#FFAAAA00"
            >
            <!-- All menu item should go here -->
        </com.vg.library.MenuBar>
    </RelativeLayout>
    

    3 回复  |  直到 13 年前
        1
  •  3
  •   aniait    16 年前

    是,将屏幕分辨率设置为WQVGA(800*432)。

        2
  •  1
  •   Viker    13 年前

    Galaxy S有这样的显示屏:

    • 超级AMOLED(C型)显示器
    • WVGA(800 x 480)子显示分辨率
    • 4.0“子显示尺寸
    • 16米主显示色深

    更多规格 http://developer.samsung.com/deviceSpecs/deviceView.do?menu=EN01030100&dvceId=47#

        3
  •  0
  •   Andro Selva Anand Wadhwani    13 年前
    <RelativeLayout 
                android:id="@+id/topBanner"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:background="#FFFFCC00"
                >
    

    为您的申请