Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 将普通布局转换为xlarge布局_Android_Android Layout - Fatal编程技术网

Android 将普通布局转换为xlarge布局

Android 将普通布局转换为xlarge布局,android,android-layout,Android,Android Layout,我使用下面的xml布局在普通布局中进行渲染。 但是,当我尝试在ASUS transformer(蜂巢或冰淇淋三明治)等xlarge屏幕上运行时,image for image按钮会从drawable mdpi资源文件夹中获取图像。甚至尝试过改变大屏幕按钮的布局和更大的图像,但相同的mdpi图像呈现 有谁能给我一些关于如何解决这个问题的建议吗。谢谢 <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="

我使用下面的xml布局在普通布局中进行渲染。 但是,当我尝试在ASUS transformer(蜂巢或冰淇淋三明治)等xlarge屏幕上运行时,image for image按钮会从drawable mdpi资源文件夹中获取图像。甚至尝试过改变大屏幕按钮的布局和更大的图像,但相同的mdpi图像呈现

有谁能给我一些关于如何解决这个问题的建议吗。谢谢

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="@drawable/white"
android:fillViewport="true"
android:tileMode="repeat" >

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
     <LinearLayout
        android:layout_alignParentTop="true"
        android:layout_width="fill_parent" 
        android:layout_height="30dip"
        android:background="#000000"
        android:tileMode="repeat"
        android:weightSum="3">

     <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1">
    <TextView 
        android:text=""
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="center"
        android:textSize="18sp"
        android:textColor="#000000"/>
    </LinearLayout>
     <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1">
          <ImageView 
            android:src="@drawable/logo1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </LinearLayout>
    <LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:layout_weight="1">
        <ImageButton 
            android:id="@+id/buttonMainBackClosetheApp"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="#000000"
            android:tileMode="repeat"/>
     </LinearLayout>

         </LinearLayout>   







<LinearLayout 
android:layout_marginTop="30dip"
android:layout_marginBottom="30dip"
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:weightSum="3" 
android:orientation="vertical">

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:weightSum="3" 
    android:orientation="horizontal"
    android:layout_marginTop="15px">

    <LinearLayout 
        android:id="@+id/linearLayoutBtnFindUs"
        android:layout_width="fill_parent"
        android:layout_weight="1" 
        android:orientation="vertical"
        android:gravity="center" 
        android:layout_height="fill_parent">

        <ImageButton 
            android:id="@+id/btnFindUs"
            android:src="@drawable/findus_icon"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:background="@drawable/white" />
        <TextView 
            android:text="Find Us" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#000000" />
    </LinearLayout>


    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_weight="1" 
        android:orientation="vertical"
        android:gravity="center" 
        android:layout_height="fill_parent">

        <ImageButton 
            android:id="@+id/btnCatalog"
            android:src="@drawable/catalog_icon"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:background="@drawable/white"/>
        <TextView 
            android:text="Catalog" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:textColor="#000000"/>
    </LinearLayout>

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1"
        android:orientation="vertical" 
        android:gravity="center">

        <ImageButton 
            android:id="@+id/btnMyContact"
            android:src="@drawable/mycontact_icon"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:background="@drawable/white"/>
        <TextView 
            android:text="My" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#000000"/>
        <TextView 
            android:text="Contacts" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#000000"/>
    </LinearLayout>
</LinearLayout>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:weightSum="3" 
    android:orientation="horizontal">
    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1"
        android:orientation="vertical" 
        android:gravity="center">

        <ImageButton 
            android:id="@+id/btnPhoto"
            android:src="@drawable/photo_icon"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:background="@drawable/white"/>
        <TextView 
            android:text="Photo" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:textColor="#000000"/>
    </LinearLayout>

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1"
        android:orientation="vertical" 
        android:gravity="center">
        <ImageButton 
            android:src="@drawable/myaccount_icon"
            android:id="@+id/btnMyAccount"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:background="@drawable/white"/>
        <TextView 
            android:text="My Account" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#000000" />
    </LinearLayout>

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1"
        android:orientation="vertical" 
        android:gravity="center">

        <ImageButton
            android:id="@+id/btnFeedback"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/white"
            android:src="@drawable/feedback_icon" />

        <TextView 
            android:text="Feedback" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#000000" />
    </LinearLayout>
</LinearLayout>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:layout_marginBottom="20px"
    android:weightSum="3" 
    android:orientation="horizontal">
    <!-- dont change the above value of 45px in 
    android:layout_marginBottom="45px"-->

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1"
        android:orientation="vertical" 
        android:gravity="center">
        <ImageButton 
            android:id="@+id/btnPromotions"
            android:src="@drawable/promotion_icon"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:background="@drawable/white" />
        <TextView 
            android:text="Promotions" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#000000"/>
    </LinearLayout>
    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_weight="1"
        android:orientation="vertical" 
        android:gravity="center"
        android:layout_height="fill_parent" >

        <ImageButton 
            android:id="@+id/btnTradeTools"
            android:src="@drawable/tradetools_icon"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:background="@drawable/white" />
        <TextView 
            android:text="Trade Tools" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:textColor="#000000"/>
    </LinearLayout>

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1"
        android:orientation="vertical" 
        android:gravity="center">
        <ImageButton 
            android:id="@+id/btnClientInfo"
            android:src="@drawable/clientinfo_icon"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:background="@drawable/white"/>
        <TextView 
            android:text="About" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:textColor="#000000"/>
    </LinearLayout>
</LinearLayout>
</LinearLayout>

   <LinearLayout
        android:layout_alignParentBottom="true"
        android:layout_width="fill_parent" 
        android:layout_height="30dip"
        android:layout_weight="1"
        android:weightSum="5" 
        android:orientation="horizontal"
        android:background="#e4e4e4"
        android:tileMode="repeat">
<include layout="@layout/footer_include_layout"/>




         </LinearLayout>


变压器有~160dpi,这使其成为mdpi屏幕。因此,从mdpi文件夹加载资源是很自然的,谢谢。你能给我一些关于如何为160dpi屏幕增强或设置更大图像的建议吗?谢谢,这意味着我必须用相同的名称再写一个布局,它应该从drawable xlarge文件夹中获取图像,并且图像名称与存储在drawable ldpi、drawable hdpi和drawable mdpi文件夹中的图像名称不同,但是emulator for 2.7的密度为120,当我从这些emulator运行时,它从drawable xlarge获取图像,这是它们控制渲染的另一种方式,对于小屏幕,小图像和大屏幕,应该渲染更大的图像。