2013-02-23 4 views
0

ScrollView가이 소스에서 작동하지 않는 이유를 알고 싶습니다.ScrollView가 안드로이드에서 작동하지 않습니다.

이 소스의 탭에는 캘린더 및 EditText가 있습니다.

EditText를 클릭하고 softKey가 튀어 나오면 스크롤하려고합니다. 탭에서

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" 
    android:fillViewport="true" 
    android:id="@+id/scroll" > 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     tools:context=".AddActivity" > 
     <TabHost 
      android:id="@android:id/tabhost" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:orientation="vertical"> 

       <TabWidget 
        android:id="@android:id/tabs" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"/> 

       <FrameLayout 
        android:id="@android:id/tabcontent" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" > 
       </FrameLayout>  

      </LinearLayout> 
     </TabHost> 
    </LinearLayout> 
</ScrollView> 

--- ---
<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"> 
<Button 
    android:id="@+id/first_button" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:text="save"/> 
<LinearLayout 
    android:id="@+id/first_LL" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:layout_alignParentTop="true" 
    android:layout_above="@id/first_button"> 
    <TextView 
     android:id="@+id/firstday" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:gravity = "center"/> 
    <add.AddCalendar 
     android:id="@+id/Cfirst" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:paddingTop="1dp" 
     android:paddingBottom="1dp" 
     />  
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" > 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text = "Date : "/> 
     <Spinner 
      android:id="@+id/first_Year" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text = "year"/> 
     <Spinner 
      android:id="@+id/first_Month" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text = "month"/> 
     <Spinner 
      android:id="@+id/first_Day" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text = "day"/> 
    </LinearLayout> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text = "sth : " 
      android:gravity="top"/> 
     <EditText 
      android:id="@+id/first_Text" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint=" write " 
      android:gravity="top"/> 
    </LinearLayout> 
</LinearLayout> 

이 코드는 잘 작동하지 않는 이유를 모르겠어요.

답변

0

난 당신이 내가 THS 전체 화면 대신있는 ScrollView와 탭에서 내 레이아웃을 포장에이 문제를 해결 전체 화면

+0

대신있는 ScrollView와 탭에서 레이아웃을 포장하고있는 LinearLayout에 RelativeLayout의 변화한다고 생각합니다. 고맙습니다. –

관련 문제