首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >android中的parallaxscroll视图不起作用

android中的parallaxscroll视图不起作用
EN

Stack Overflow用户
提问于 2014-11-03 14:07:53
回答 1查看 776关注 0票数 0

嗨,我正在尝试使用下面链接中的库在我的应用程序中实现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。

但什么也没发生。谁能给我解释一下该怎么做?提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2018-06-13 04:33:00

之所以会出现此问题,是因为依赖项使用implementation 'com.github.nirhart:parallaxscroll:1.0'不能与compileSdkVersion 27或新版本一起使用,

您可以从github下载模块,并在您的项目中使用impot模块,并使用您的项目sdk版本进行更新。this is my project update library gradle sdk version

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26708706

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档