2011-10-14 2 views
0

안녕하세요, 전체 레이아웃을위한 배경 이미지를 설정 한 XML 파일이 있습니다. 그 다음에는 2 개의 텍스트 상자와 하나의 단추 이미지를 넣습니다.하지만 편집 상자에 입력 할 때 softkeyboard는 단추 이미지를 숨 깁니다. 데이터를 submmit 위해 전체 레이아웃을위한 scrool을 설정하고 싶습니다. 그러나 스크롤을 설정하면 전체 UI 레이아웃이 아닌 전체 화면 레이아웃으로 스크롤됩니다. 그래서 모든 UI가 왜곡됩니다. 그래서 내 전체 XML을 pls 아래로 수정합니다. 내 코드에전체 레이아웃에 스크롤을 설정하십시오 android

감사

<?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:layout_gravity="center" 
android:background="@drawable/user_id_bg2" > 
    <EditText 
    android:inputType="text|textNoSuggestions" 

android:text="" 
android:id="@+id/editText1" 
android:singleLine="true" 
android:hint="Enter Your User Id" 
android:layout_marginTop="85dip" 
android:layout_marginLeft="20dip" 
android:layout_marginRight="20dip" 
android:layout_height="40dip" 
android:layout_width="fill_parent"> 
</EditText> 
<EditText 
android:inputType="text|textNoSuggestions" 
android:password="true" 
android:singleLine="true" 
android:hint="Enter Your Password" 
android:layout_marginTop="125dip" 
android:layout_marginLeft="20dip" 
android:layout_marginRight="20dip" 
android:id="@+id/editText2" 
android:imeOptions="actionDone" 
android:layout_height="40dip" 
android:layout_width="fill_parent"/> 
<ImageView 
android:id="@+id/buttonimg" 
android:layout_below="@id/editText2" 
android:layout_marginLeft="237dip" 
android:layout_width="wrap_content" 
android:layout_height="40dip" 
android:background="@drawable/go_button" 
/> 

답변

1

당신은있는 ScrollView 안에 모든 것을 넣을 수 없다?

<?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="fill_parent""> 
    <RelativeLayout 
      android:orientation="vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_gravity="center" 
      android:background="@drawable/user_id_bg2" > 
... 
+0

난 스크롤 뷰에 모든 것을 넣어 경우 다음 배경 이미지 내가 – shyam

+1

가있는 ScrollView 등이있는 레이아웃에 배경을 설정하려고 스크롤없이 보여주고 싶은 스크롤이 그것을 아래로 스크롤하지 않고 전체를 오는되지 않음을 의미하고 있습니다 유일한 아이와 그 안의 다른 모든 것들? – Martyn

관련 문제