2010-11-29 13 views
0

私の問題では、私のビューのEditTextボックスで解決できない問題があります。 eclipseで私のビューのいずれかをプレビューすると、EditTextボックスは小さくて大きなスクリーンでよく見え、期待通りの縮尺で表示されます。しかし、小さな画面では画面の高さが大きくなります。それらは幅okで拡大縮小して表示されますが、高さが増えてテキストと枠線の間に余白が残ります。EditTextボックスは小さな画面では縮尺されません

XMLは非常に小さい:

<EditText android:id="@+id/width" 
android:layout_height="wrap_content" 
android:layout_width="fill_parent" 
android:hint="Slab Width (mm)" 
android:inputType="phone" 
> 
</EditText> 

私はボックスが画面に合わせて高さにスケーリングされると予想しているでしょう。 高さに尺度がないのは驚きです。 私はそれが物理的な高さで大きくなることにショックを受けました...?

小画面:http://www.doobox.co.uk/rapidimages/smallscreen.png

編集:この問題を持っている。その実際QVGA & WQVGA画面...!

私はあなたが完全なXMLが必要になると思う:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
android:id="@+id/widget36" 
android:background="@drawable/linen_bg" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android" 
> 
<LinearLayout 
android:id="@+id/main_linear" 
android:layout_width="fill_parent" 
android:orientation="vertical" 
android:layout_alignParentTop="true" 
android:layout_alignParentLeft="true" 
android:layout_marginLeft="20dip" android:layout_marginRight="20dip" android:layout_height="wrap_content"> 
<ImageView 
android:id="@+id/logo" 
android:background="@drawable/conc_logo" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_gravity="center_horizontal" 
android:layout_marginTop="15dip" 
> 
</ImageView> 
<TextView android:text="Slab Calculator" 
android:id="@+id/TextView01" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_gravity="center_horizontal" 
android:textSize="20sp" 
android:textColor="#333333" 
android:layout_marginTop="20dip"> 
</TextView> 



<EditText android:id="@+id/length" 
android:layout_width="fill_parent" 
android:inputType="phone" 
android:fitsSystemWindows="true" 
android:hint="Height of Slab (mm)" 
android:layout_height="wrap_content"> 
</EditText> 



<TextView android:text="**.** Cubic Meter's" 
android:id="@+id/slab_result" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:textSize="20sp" 
android:textColor="#333333" 
android:layout_marginTop="5dip"> 
</TextView> 

<TextView android:text="£**.** Total" 
android:id="@+id/slab_cost" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:textSize="20sp" 
android:textColor="#333333" 
android:layout_marginTop="5dip"> 
</TextView> 
</LinearLayout> 
<RelativeLayout android:id="@+id/bottom_container" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:padding="20dip" 
android:layout_alignParentBottom="true" 
android:layout_centerHorizontal="true" 
> 
<Button 
android:id="@+id/calculate_button" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_alignParentTop="true" 
android:layout_alignParentRight="true" 
android:drawableTop="@drawable/calculate" 
android:text="Calculate" 
android:background="@android:color/transparent"> 
</Button> 
</RelativeLayout> 
</RelativeLayout> 
+0

それほど間違っていないよ1.6

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/> 

から最初にサポートされます。どのようなサイズですか?そして最も重要なのは、あなたがテストしたスクリーンの密度は何ですか? –

+0

私はちょうどポストに完全なXMLを加えました..! – 11Monkeys

+0

あなたが高さwrap_contentに使用していますが、それがスケーリングされる理由は私にとっては変です – Tima

答えて

0

あなたの問題がマニフェストにある可能性があります。すべての画面用

サポートが

<supports-screens 
    android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true" /> 

もう一つは宣言する必要があり、SDK APIの4は同様にあなたのマニフェストで宣言する必要があります。小さな画面は希望が、私はあなたがより正確にする必要があります

+0

私はこれをマニフェストに追加しました。喜びはありません。私はちょうどテストで締め切りました:私は新しいプロジェクトアンドロイド1.6、api4を作成し、レイアウトへの領域..うまく動作します..!私が抱えている問題はおそらく私のXMLにはありません。マニフェストやアクティビティの可能性が高いです。 – 11Monkeys

+0

あなたのXMLは正しいとも言えます。プロジェクトの目標SDKを1.6に変更しようとしましたか?それとも2.2まで? – Tima

+0

私はあなたの答えの助けを借りて問題を見つけたと思います、私はターゲット2.1のAPIレベル7でプロジェクトを構築しました...この段階でマニフェストにmin sdkとtarget sdkを追加すると、問題。マニフェストにエラーを作成するだけです。バージョンは一致しません..! – 11Monkeys

0

EditTextためandroid:paddingを指定して明示的に試してみて、それが役立つかもしれないかどうかを確認します。

+0

悪い今しよう..! – 11Monkeys

+0

明示的なパディングは問題を解決しませんが、ありがとう.. – 11Monkeys

関連する問題