开发者

I would Like to make this screen resolution good for all size of screen what i should change

I have few screen i my app and i try to make them good for all size of screen but no successful so i attach the screen and hope for help.

what i would like to get in this screen is: 1.the widget43 to be on top of the screen 2.the widget49 in the middle of the screen 3.the widget47 the problem one in the bottom of the screen even if the widget49 don't take all the space.

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout
 android:id="@+id/widget42"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:orientation="vertical"
 xmlns:android="http://schemas.android.com/apk/res/android"
  >
<RelativeLayout
 android:id="@+id/widget43"
 android:layout_width="fill_parent"
 android:layout_height="34px"
 android:background="@color/blue"
  >
  <TextView
  android:id="@+id/convertedTitleTextView"
   android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="TextView"
 android:layout_centerVertical="true"
 android:layout_centerHorizontal="true"
   >
  </TextView>
  <Button
android:id="@+id/convert开发者_如何学JAVAedBackButton"
android:layout_width="wrap_content"
android:layout_height="32px"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:onClick="backButtonOnClick"
android:text="Back" android:typeface="monospace" android:textColor="@color/white"         android:textColorHint="@color/blue" android:background="@color/blue">
 </Button>
 <Button
  android:id="@+id/convertedCancelButton"
  android:layout_width="wrap_content"
  android:layout_height="32px"
 android:layout_alignParentBottom="true"
 android:layout_alignParentRight="true"
 android:onClick="cancelButtonOnClick"
 android:text="Cancel" android:background="@color/blue"    android:textColor="@color/white">
 </Button>
 </RelativeLayout>
 <RelativeLayout
 android:id="@+id/widget49"
 android:layout_width="fill_parent" android:layout_gravity="bottom"    android:layout_height="310dip">
 <ListView
  android:layout_width="fill_parent"
  android:layout_alignParentTop="true"
  android:id="@+id/convertedListView" android:hapticFeedbackEnabled="true"
  android:layout_below="@+id/widget47" android:layout_above="@+id/widget49"  android:layout_alignBottom="@+id/widget43" android:layout_height="match_parent">
 </ListView>
 </RelativeLayout>
 <RelativeLayout android:id="@+id/widget47" android:background="@color/blue"  android:layout_width="match_parent" android:layout_height="wrap_content">
  <TextView android:layout_centerVertical="true" android:layout_height="wrap_content"    android:layout_width="wrap_content" android:layout_centerHorizontal="true"  android:id="@+id/countConvertedTextView" android:text="TextView"></TextView>
</RelativeLayout>
</LinearLayout>

thanks for helping!!!


what bad is going on with different screen size? better to put different size images in different drawable folders as i mentioned below.

drawable drawable-hdpi drawable-ldpi drawable-mdpi


Do one thing...add this property in the relative layout which has id of widget47

android:layout_below="@+id/widget49"

So your relative layout will look like

<RelativeLayout android:id="@+id/widget47"
    android:layout_below="@+id/widget49" android:background="@color/blue"
    android:layout_width="fill_parent" android:layout_height="wrap_content">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜