2013-03-11 3 views
1

LinearLayout에 6 TextViews을 표시하고 있습니다. 이 모든 LinearLayout에 대해 ScrollView을 보관했습니다. 나는 slidingdrawer에 대한 내용으로 LinearLayout ID (contentlayout)를 추가하면스크롤 뷰가 너무 느립니다.

My Code is as follows... 
<LinearLayout 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/mobilepage" 
    android:orientation="vertical" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="10dp" 
     android:gravity="center" 
     android:orientation="horizontal" > 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="160dp" 
      android:layout_height="30dp" 
      android:src="@drawable/logo" /> 

    </LinearLayout> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" > 

      <FrameLayout 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:layout_marginTop="10dp" > 

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

        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="wrap_content" 
         android:gravity="center_horizontal" 
         android:orientation="horizontal" > 

         <TextView 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:paddingTop="5dp" 
          android:text="SIGN IN" 
          android:textColor="@color/white" 
          android:textSize="18dp" 
          android:typeface="sans" /> 

        </LinearLayout> 

        <EditText 
         android:id="@+id/etUsername" 
         android:layout_width="230dp" 
         android:layout_height="40dp" 
         android:layout_marginTop="8dp" 
         android:background="@drawable/edittext_bg_siginusername" 
         android:hint="Email or username" 
         android:textSize="14dp" 
         android:typeface="sans" /> 

        <EditText 
         android:id="@+id/etPassword" 
         android:layout_width="230dp" 
         android:layout_height="40dp" 
         android:background="@drawable/edittext_bg_signinpassword" 
         android:hint="Password" 
         android:password="true" 
         android:textSize="14dp" 
         android:typeface="sans" /> 

        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center_horizontal" 
         android:gravity="center_horizontal" > 

         <CheckBox 
          android:id="@+id/cbUserpass" 
          android:layout_width="122dp" 
          android:layout_height="wrap_content" 
          android:layout_marginRight="100dp" 
          android:paddingTop="3dp" 
          android:text="Remember me" 
          android:textColor="@color/white" 
          android:textSize="10dp" 
          android:textStyle="bold" /> 

        </LinearLayout> 

        <Button 
         android:id="@+id/bSignin" 
         android:layout_width="186dp" 
         android:layout_height="38dp" 
         android:layout_gravity="center" 
         android:background="@drawable/signinbutton" 
         android:paddingBottom="6dp" 
         android:text="SIGN IN" 
         android:textColor="@color/white" 
         android:textSize="14dp" 
         android:typeface="sans" /> 

        <Button 
         android:id="@+id/bSigninFacebook" 
         android:layout_width="186dp" 
         android:layout_height="38dp" 
         android:layout_gravity="center" 
         android:layout_marginTop="20dp" 
         android:background="@drawable/signinbutton" 
         android:paddingBottom="6dp" 
         android:text="Login via Facebook" 
         android:textColor="@color/white" 
         android:textSize="14dp" 
         android:typeface="sans" /> 

       </LinearLayout> 

       <SlidingDrawer 
        android:id="@+id/SlidingDrawer" 
        android:layout_width="fill_parent" 
        android:layout_height="300dp" 
        android:content="@+id/contentLayout" 
        android:handle="@+id/slideButton" 
        android:orientation="horizontal" > 

        <Button 
         android:id="@+id/slideButton" 
         android:layout_width="34dp" 
         android:layout_height="65dp" 
         android:background="@drawable/slidedrawer" > 
        </Button> 

        <LinearLayout 
         android:id="@+id/contentLayout" 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:layout_gravity="center_horizontal" 
         android:gravity="center_horizontal" > 

         <ScrollView 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent"> 

          <LinearLayout 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:background="@drawable/royalblue_transparent" 
           android:gravity="center" 
           android:orientation="vertical" > 
     .............6 textViews     
          </LinearLayout> 
         </ScrollView> 
        </LinearLayout> 
       </SlidingDrawer> 
      </FrameLayout> 
     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 

ScrollView는 매우 느립니다. 같은 이드가 ScrollView에 머물렀을 때 작동하지 않습니다.

정상적으로 스크롤 뷰를 만드는 데 도움을주십시오. 나는이 유형의 질문을 찾았지만 도움이되지는 못했습니다. 미리 감사드립니다.

+0

슬라이딩 드로어에 없으면 여전히 느린가요? – QVDev

+1

SlidingDrawer는 더 이상 사용되지 않습니다. 이 클래스는 API 레벨 17에서 사용되지 않습니다. check : http://developer.android.com/reference/android/widget/SlidingDrawer.html –

+0

@QVDev 6 개의 textviews에 일부 정보를 표시하기 때문에 slidingdrawer를 사용해야합니다. 해당 텍스트 뷰는 화면의 버튼을 클릭하면 표시됩니다. 나는이 모든 것들이 스크롤 뷰 아래에있는 다른 LinearLayout 아래있는 XML 코드의 일부를 게시했다. 원한다면 내가 사용하고있는 전체 XML 구문을 게시 할 것입니다. –

답변

1

LinearLayout에서 LinearLayout을 사용하지 마십시오. linearLayout의 최대 2 레벨 (직선 내부 선형)을 확보하십시오. 화면에 최종 레이아웃을 표시하는 데 여러 번 반복됩니다. 어느 정도 성과를 향상시킬 것입니다.