2014-11-03 6 views
0

안녕을 작동하지 않습니다 : - 아래parallaxscroll보기 내가 아래 링크에서 라이브러리를 사용하여 내 응용 프로그램에서 parallaxscrollview을 달성하기 위해 노력하고

https://github.com/nirhart/ParallaxScroll

을 그리고있는 내 XML 코드 : -

<com.nirhart.parallaxscroll.views.ParallaxScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:inner_parallax_factor="1.9" 
    app:parallax_factor="1.9" 
    app:parallax_views_num="3" 
    android:background="@drawable/bg_profile_summary" > 

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

    <LinearLayout 
      android:id="@+id/LIN_First" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:baselineAligned="false" 
      android:weightSum="2" > 

      <RelativeLayout 
       android:id="@+id/REL_People" 
       android:layout_width="0dp" 
       android:layout_height="60dp" 
       android:layout_weight="1" 
       android:background="@drawable/bg_profile_list_item" 
       android:padding="10dp" > 

       <TextView 
        android:id="@+id/TXT_Title" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerVertical="true" 
        android:layout_gravity="center_vertical" 
        android:layout_marginLeft="5dp" 
        android:textStyle="bold" 
        android:text="@string/str_txt_people" 
        android:textColor="#FFFFFF" /> 

       <ImageView 
        android:id="@+id/IMG_Right_Arrow" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentRight="true" 
        android:layout_centerVertical="true" 
        android:layout_gravity="right" 
        android:contentDescription="@string/app_name" 
        android:src="@drawable/ic_nav_right_white" /> 
      </RelativeLayout> 

      <RelativeLayout 
       android:id="@+id/REL_Popular" 
       android:layout_width="0dp" 
       android:layout_height="60dp" 
       android:layout_weight="1" 
       android:background="@drawable/bg_profile_list_item" 
       android:padding="10dp" > 

       <TextView 
        android:id="@+id/TXT_TitlePopular" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerVertical="true" 
        android:layout_gravity="center_vertical" 
        android:layout_marginLeft="5dp" 
        android:textStyle="bold" 
        android:text="@string/str_txt_popular" 
        android:textColor="#FFFFFF" /> 

       <ImageView 
        android:id="@+id/IMG_Right_Arrow1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentRight="true" 
        android:layout_centerVertical="true" 
        android:layout_gravity="right" 
        android:contentDescription="@string/app_name" 
        android:src="@drawable/ic_nav_right_white" /> 
      </RelativeLayout> 

      </LinearLayout> 

    <RelativeLayout 
       android:id="@+id/REL_Official_Act" 
       android:layout_width="match_parent" 
       android:layout_height="60dp" 
       android:layout_below="@+id/LIN_First" 
       android:background="@drawable/bg_profile_list_item" 
       android:padding="10dp" > 

       <TextView 
        android:id="@+id/TXT_OfficialAccounts" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerVertical="true" 
        android:layout_gravity="center_vertical" 
        android:layout_marginLeft="5dp" 
        android:textStyle="bold" 
        android:text="@string/str_official_accounts" 
        android:textColor="#FFFFFF" /> 

       <ImageView 
        android:id="@+id/IMG_Right_Arrow3" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentRight="true" 
        android:layout_centerVertical="true" 
        android:layout_gravity="right" 
        android:contentDescription="@string/app_name" 
        android:src="@drawable/ic_nav_right_white" /> 
      </RelativeLayout> 



      <RelativeLayout 
       android:id="@+id/REL_Search" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/REL_Official_Act" 
       android:layout_marginBottom="10dp" 
       android:layout_marginTop="10dp" 
       android:paddingLeft="10dp" 
       android:paddingRight="10dp" > 

       <EditText 
        android:id="@+id/EDT_Search_text" 
        android:layout_width="250dp" 
        android:layout_height="35dp" 
        android:background="@drawable/ic_search_text_background" 
        android:hint="@string/str_edt_searchanything_hint" 
        android:paddingBottom="2dp" 
        android:paddingLeft="15dp" 
        android:paddingTop="2dp" /> 

       <RelativeLayout 
        android:id="@+id/REL_SearchButton" 
        android:layout_width="wrap_content" 
        android:layout_height="35dp" 
        android:layout_alignParentRight="true" 
        android:layout_alignParentTop="true" 
        android:layout_toRightOf="@+id/EDT_Search_text" 
        android:background="@drawable/ic_search_btn_bg" 
        android:gravity="center" > 

        <Button 
         android:id="@+id/BTN_Search" 
         android:layout_width="30dp" 
         android:layout_height="30dp" 
         android:layout_centerVertical="true" 
         android:background="@drawable/ic_search" 
         android:padding="5dp" /> 
       </RelativeLayout> 
      </RelativeLayout> 



      <ListView 
       android:id="@+id/LST_AlbumList" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_margin="10dp" 
       android:layout_alignParentBottom="true" 
       android:layout_below="@+id/REL_Search" 
       android:dividerHeight="0dip" > 
      </ListView> 

</RelativeLayout> 
</com.nirhart.parallaxscroll.views.ParallaxScrollView> 

MultipleParallaxScrollView를 달성하려고합니다.

하지만 아무 일도 일어나지 않습니다. 아무도 나에게 무엇을 설명해 주시겠습니까 ?? 미리 감사드립니다.

+0

* 아무 일도 일어나지 않습니다. *? 어떤 오류가 있습니까? –

+0

@SweetWisher ツ : 나는 어떤 오류도 내지 않는다. 스크롤링도 없습니다. . –

+0

해당 링크에서 데모 프로젝트를 성공적으로 실행할 수 있습니까? –

답변

1

당신은 ParallaxScrollView에서 자식으로 있는 LinearLayout를 사용해야합니다.

당신은 ParallaxScrollView 한 아이를 배치해야

전체 내용을 포함하는 스크롤; LinearLayout

+0

아직도 작동하지 않습니다 – kgandroid