2012-10-12 14 views
0

320x480의 저밀도 화면에서 렌더링 한 다음과 같은 활동이 있습니다 (오른쪽의 검은 색 스트립에는 신경을 쓰지 마십시오. 화면 캡처).입력시 초점이 맞을 때 스크롤 뷰에서 텍스트 필드를 이동하는 방법

enter image description here

EditText의 실제로하는 ScrollView --there의 여섯 그들로 묶습니다. 가입 버튼은 RelativeLayout을 통해 다른 모든 요소가 배치되는 동안 LinearLayout을 무게 측정을 통해 ScrollView과 공유합니다. 내가 부모가 이동 RelativeLayout 할 수있는 방법

enter image description here

내 질문입니다 만이 아니라 ScrollView : 나는 "전자 메일"텍스트 필드 (네 번째)에 탭하면,이 보여줍니다 무엇인가 전자 메일 텍스트 필드를 더 잘 보이게하려면? 또한 가입 버튼의 힌트는 꽤 추합니다. 내가 그것을 피할 수있는 방법이 있습니까? 다음은 레이아웃 용 XML 코드입니다.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/bg_320x480"> 

    <TextView android:id="@+id/signup_logo_txt" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="#0a6698" 
     android:textColor="#ff7f00" 
     android:text="Blackened App Name" 
     android:textStyle="bold" 
     android:textSize="10pt" 
     android:gravity="center" 
     android:padding="8dp" 
     /> 

    <ImageView android:id="@+id/signup_icons_ghost_img" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:src="@drawable/icons_ghost_320x112" 
     android:layout_below="@id/signup_logo_txt" 
     android:contentDescription="lalalala" 
     android:layout_marginTop="-21dp" 
     /> 

    <TextView android:id="@+id/signup_tagline_txt" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="The easiest way to find a mobile plan that best suits how you use your phone." 
     android:textColor="#000" 
     android:textSize="5pt" 
     android:gravity="center" 
     android:layout_below="@id/signup_logo_txt" 
     android:layout_marginTop="10dp" 
     /> 

    <TextView android:id="@+id/signup_getstarted_txt" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="Sign up and let's get started!" 
     android:textColor="#0a6998" 
     android:textSize="6pt" 
     android:textStyle="bold" 
     android:gravity="center" 
     android:layout_below="@id/signup_tagline_txt" 
     android:layout_marginTop="6dp" 
     /> 

    <LinearLayout android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:weightSum="1.0" 
     android:layout_marginLeft="10dp" 
     android:layout_marginRight="10dp" 
     android:layout_below="@id/signup_getstarted_txt" 
     > 
     <ScrollView android:id="@+id/signup_fields_view" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight=".8"> 
      <LinearLayout android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       > 
       <EditText android:id="@+id/signup_name_fld" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:hint="Navn" 
        android:layout_marginTop="5dp" 
        /> 

       <EditText android:id="@+id/signup_carrier_fld" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:hint="Nuvaerende mobilselskab" 
        android:layout_marginTop="3dp" 
        /> 

       <EditText android:id="@+id/signup_plan_fld" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:hint="Mobilforbrug i kroner" 
        android:layout_marginTop="3dp" 
        /> 

       <EditText android:id="@+id/signup_email_fld" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:hint="E-mail" 
        android:layout_marginTop="3dp" 
        /> 

       <EditText android:id="@+id/signup_verify_email_fld" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:hint="Bekraeft e-mail" 
        android:layout_marginTop="3dp" 
        /> 

       <EditText android:id="@+id/signup_mobile_number_fld" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:singleLine="true" 
        android:hint="Mobilnummer" 
        android:layout_marginTop="3dp" 
        /> 
      </LinearLayout> 
     </ScrollView> 

     <Button android:id="@+id/signup_signup_btn" 
      android:layout_width="wrap_content" 
      android:layout_height="0dp" 
      android:layout_weight=".2" 
      android:text="SIGN UP" 
      android:textColor="#fff" 
      android:layout_gravity="center" 
      android:layout_marginBottom="8dp" 
      /> 
    </LinearLayout> 

</RelativeLayout> 

답변

1

나는 것은 당신이없는 일

+0

이봐, 매니페스트 파일에 활동에 pan.set android:windowSoftInputMode="adjustPan"을 조정 설정합니다. ScrollView 덕분에 좀 이상하지만, 적어도 이상한 가입 버튼은 없어졌습니다. –

관련 문제