2010-11-29 4 views
0

내보기의 EditText 상자로 해결할 수없는 문제가 있습니다. 이클립스에서 내 뷰를 미리 보면 EditText 상자가 작고 큰 화면에서 잘 보이고 예상대로 확장됩니다. 그러나 작은 화면에서는 화면의 높이가 더 커집니다. 그들은 너비가 넓어 보이지만 높이가 커지므로 텍스트와 테두리 사이에 여백이 더 많이 남습니다. 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

당신은 더 정확해야하므로 잘못 아니에요. 어떤 크기? 가장 중요한 것은 테스트 한 화면의 밀도는 무엇입니까? –

+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)는 매니페스트도 선언해야한다. 작은 화면은 1.6

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

희망에서 처음으로 지원 될 것입니다, 나는

+0

나는 기쁨없이 매니페스트에 이것을 추가했습니다. 테스트와 결론을 맺은 것은 다음과 같습니다. 새 프로젝트 인 android 1.6, api4를 만든 다음 하나를 추가했습니다. editText 레이아웃 영역 .. 잘 작동 ..! 그래서 내가 가지고있는 문제는 아마도 내 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

관련 문제