English 中文(简体)
GUI不同的决议
原标题:Different GUI resolutions in Android RelativeLayout

我对海底的不同决议有疑问。 我在相关的Layout编篡了一个Xml GUI文件。 Ive造就了小幅画面,在图象旁边,我想读书。 我的问题是,在我改变决议时,“案文”的行文,我很抱歉,这会在不同的决议中看不到。

What I have done now, I for example create a image, toRightOf that image I create a textview and this textview is below another image with for example 19 pixels. But if I change the resolution, the 19 pixels can be to much or to low in distance, and the text from the texview will be shown in the wrong position on the screen.

如何用不同的决议来解决这一问题,并建立一个以现实态度界定食谱距离的智囊团。 我常常想像你在我下面的法典中看到的那样,在不同的文本概览之间保持距离。

This is my example code:

<?xml version="1.0" encoding="utf-8"?>
      <ScrollView android:id="@+id/ScrollView01"
        xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        >

      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:stretchColumns="1"
       android:weightSum="1.0"
       android:background="#adaeb5">


       <TextView android:text="@+id/TextView03" android:id="@+id/TextView03"

       android:layout_width="wrap_content" android:layout_height="wrap_content"
       android:layout_centerHorizontal="true" 
                android:textStyle="bold"
                android:textSize="21dp"
                android:shadowDy="1.5"
                android:textColor="#FFFFFF"
                android:shadowColor="#212421"
                android:shadowRadius="1.5"
                android:shadowDx="1.5"/>

   <ImageView android:id="@+id/ImageView01"

       android:layout_width="wrap_content" android:layout_height="wrap_content"
       android:layout_below="@+id/TextView03" android:paddingTop="35px"


 />


       <ImageView android:id="@+id/ImageView02"

       android:layout_width="wrap_content" android:layout_height="wrap_content"
       android:layout_below="@+id/ImageView01" android:paddingTop="20px"

 />

       <ImageView android:id="@+id/ImageView03"

       android:layout_width="wrap_content" android:layout_height="wrap_content"
       android:layout_below="@+id/ImageView02" android:paddingTop="20px"

 />
   <ImageView android:id="@+id/ImageView04"

       android:layout_width="wrap_content" android:layout_height="wrap_content"
       android:layout_below="@+id/ImageView03" android:paddingTop="20px"

 />


       <TextView android:text="@+id/TextView01" android:id="@+id/TextView01"
        android:shadowDy="1.0"
        android:shadowColor="#bdbebd"
        android:shadowRadius="1.0"
        android:shadowDx="1.0"
       android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#212421"
       android:layout_toRightOf="@+id/ImageView01" android:layout_below="@+id/TextView03" android:paddingTop="36px"/>

       <TextView android:text="@+id/TextView02" android:id="@+id/TextView02"
        android:shadowDy="1.0"
        android:shadowColor="#bdbebd"
        android:shadowRadius="1.0"
        android:shadowDx="1.0"
       android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#212421"
       android:layout_below="@+id/TextView01" android:layout_toRightOf="@+id/ImageView02" android:paddingTop="25px"/>

       <TextView android:text="@+id/TextView04" android:id="@+id/TextView04"
        android:shadowDy="1.0"
        android:shadowColor="#bdbebd"
        android:shadowRadius="1.0"
        android:shadowDx="1.0"
       android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#212421"
       android:layout_below="@+id/TextView02" android:layout_toRightOf="@+id/ImageView03" android:paddingTop="15px"/>

       <TextView android:text="@+id/TextView05" android:id="@+id/TextView05"
        android:shadowDy="1.0"
        android:shadowColor="#bdbebd"
        android:shadowRadius="1.0"
        android:shadowDx="1.0" 
       android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#212421"
       android:layout_below="@+id/TextView04" android:layout_toRightOf="@+id/ImageView04" android:paddingTop="19px"/>



       <TextView android:text="@+id/TextView07" android:id="@+id/TextView07"
                android:textStyle="bold"
                android:textSize="21dp"
                android:shadowDy="1.5"
                android:textColor="#FFFFFF"
                android:shadowColor="#212421"
                android:shadowRadius="1.5"
                android:shadowDx="1.5"
       android:layout_width="wrap_content" android:layout_height="wrap_content"
       android:layout_centerHorizontal="true" android:layout_below="@+id/TextView05" android:paddingTop="30px"/>

       <TextView android:text="@+id/TextView08" android:id="@+id/TextView08"
        android:shadowDy="1.0"
        android:shadowColor="#bdbebd"
        android:shadowRadius="1.0"
        android:shadowDx="1.0"
        android:paddingLeft="20px"
        android:paddingRight="25px" 
       android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#212421" android:textSize="16dp"
       android:layout_below="@+id/TextView07" android:layout_toRightOf="@+id/ImageView05" android:paddingTop="20px" android:paddingBottom="20px"/>



       <Button android:id="@+id/help_button2" android:layout_below="@+id/TextView08"

       android:layout_width="wrap_content" android:layout_height="wrap_content"

       android:layout_centerHorizontal="true" android:text="Previous" />




      </RelativeLayout>
</ScrollView>

页: 1

问题回答

更改<代码>dp 页: 1 甲状腺本身对此表示支持和提出。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签