android - ScrollView doesn't scroll in layout? -
i have in order relativelayout / scrollview / relative layout / relative layout , inside last relative layout have 2 linear layouts.
don't know why happening. have same layout other activity , it's working.
here xml code:
<?xml version="1.0" encoding="utf-8"?> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" > <scrollview android:layout_width="match_parent" android:layout_height="4000dp" android:paddingbottom="5dp" android:paddingleft="5dp" android:paddingright="5dp" android:paddingtop="5dp" android:orientation="vertical" android:scrollbars="none" android:background="@drawable/url" > <relativelayout android:id="@+id/relativelayout" android:layout_width="match_parent" android:layout_height="wrap_content" > <!-- thumbnail image --> <com.dusandimitrijevic.modification.touchimageview android:id="@+id/thumbnail" android:layout_width="115dp" android:layout_height="180dp" android:layout_alignparentleft="true" android:layout_marginright="8dp" android:src="@drawable/ic_horor_filmovi_ikonica" /> <!-- naslov filma --> <textview android:id="@+id/naslov" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_torightof="@id/thumbnail" android:text="naslov" android:textappearance="?android:attr/textappearancelarge" > </textview> <!-- godina izdanja filma --> <textview android:id="@+id/releaseyear" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/naslov" android:layout_alignparentright="true" android:layout_below="@+id/naslov" android:layout_margintop="3dp" android:text="textview" android:textcolor="@color/black" /> <imageview android:id="@+id/rating_star" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/thumbnail" android:layout_marginbottom="42dp" android:layout_torightof="@+id/thumbnail" android:src="@drawable/ic_actions_rating_icon" /> <button android:id="@+id/url_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/thumbnail" android:layout_alignright="@+id/scrollview" android:layout_torightof="@+id/thumbnail" android:background="@color/transparent_grey" android:text="pogledaj insert iz filma" /> <textview android:id="@+id/rating" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/rating_star" android:layout_aligntop="@+id/rating_star" android:layout_torightof="@+id/rating_star" android:gravity="center" android:text="textview" android:textcolor="@color/black" android:textsize="@dimen/rating" /> <!-- opis filma --> <relativelayout android:id="@+id/relativelayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_below="@+id/thumbnail" android:layout_margintop="14dp" android:background="@drawable/layout_round_rect_shape" > <textview android:id="@+id/description" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="18dp" android:layout_margintop="16dp" android:scrollbars="vertical" android:text="textview" android:textcolor="#7f0000" android:textsize="18sp" /> </relativelayout> <!-- opis filma zavrsetak --> <!-- glumci --> <relativelayout android:id="@+id/relativelayout2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/relativelayout1" android:layout_margintop="12dp" android:background="@drawable/layout_round_rect_shape" android:orientation="vertical" > <linearlayout android:id="@+id/linearlayoutactors" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <com.android.volley.toolbox.networkimageview android:id="@+id/image1" android:layout_width="40dp" android:layout_height="140dp" android:layout_gravity="center_horizontal" android:layout_margintop="16dp" android:layout_weight="1" android:scaletype="fitcenter" android:src="@drawable/ic_horor_filmovi_ikonica" /> <com.android.volley.toolbox.networkimageview android:id="@+id/image2" android:layout_width="40dp" android:layout_height="140dp" android:layout_gravity="center_horizontal" android:layout_margintop="16dp" android:layout_weight="1" android:scaletype="fitcenter" android:src="@drawable/ic_horor_filmovi_ikonica" /> <com.android.volley.toolbox.networkimageview android:id="@+id/image3" android:layout_width="40dp" android:layout_height="140dp" android:layout_gravity="center_horizontal" android:layout_margintop="16dp" android:layout_weight="1" android:scaletype="fitcenter" android:src="@drawable/ic_horor_filmovi_ikonica" /> </linearlayout> <linearlayout android:id="@+id/linearlayouttextview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/linearlayoutactors" android:orientation="horizontal" > <textview android:id="@+id/ime1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="ime" android:textcolor="#7f0000" android:textsize="20sp" /> <textview android:id="@+id/ime2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="ime" android:textcolor="#7f0000" android:textsize="20sp" /> <textview android:id="@+id/ime3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="ime" android:textcolor="#7f0000" android:textsize="20sp" /> </linearlayout> </relativelayout> <!-- glumci --> <!-- slike --> <relativelayout android:id="@+id/relativelayout3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_margintop="12dp" android:orientation= "vertical" android:layout_below="@+id/relativelayout2" > <linearlayout android:background="@drawable/layout_round_rect_shape" android:id="@+id/linearlayoutimages" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="186dp" android:fadingedge="vertical" /> <com.dusandimitrijevic.modification.touchimageview android:id="@+id/image1" android:layout_width="115dp" android:layout_height="150dp" android:src="@drawable/ic_horor_filmovi_ikonica" > </com.dusandimitrijevic.modification.touchimageview> <com.dusandimitrijevic.modification.touchimageview android:id="@+id/image2" android:layout_width="115dp" android:layout_height="150dp" android:src="@drawable/ic_horor_filmovi_ikonica" > </com.dusandimitrijevic.modification.touchimageview> <com.dusandimitrijevic.modification.touchimageview android:id="@+id/image3" android:layout_width="115dp" android:layout_height="150dp" android:src="@drawable/ic_horor_filmovi_ikonica" > </com.dusandimitrijevic.modification.touchimageview> <com.dusandimitrijevic.modification.touchimageview android:id="@+id/image4" android:layout_width="115dp" android:layout_height="150dp" android:src="@drawable/ic_horor_filmovi_ikonica" > </com.dusandimitrijevic.modification.touchimageview> </linearlayout> </relativelayout> <!-- slike --> </relativelayout> </scrollview> </relativelayout>
update:
layout has scrollview , working:
<?xml version="1.0" encoding="utf-8"?> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" > <scrollview android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:background="@drawable/url" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:scrollbars="none" > <relativelayout android:id="@+id/relativelayout" android:layout_width="match_parent" android:layout_height="match_parent" > <com.android.volley.toolbox.networkimageview android:id="@+id/slika" android:layout_width="match_parent" android:layout_height="380dp" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:src="@drawable/ic_horor_filmovi_ikonica" /> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/slika" android:layout_alignright="@+id/slika" android:layout_below="@+id/slika" android:layout_margintop="14dp" android:text="orginalni naslov:" android:textappearance="?android:attr/textappearancelarge" /> <textview android:id="@+id/naslov" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/textview1" android:layout_alignright="@+id/textview1" android:layout_below="@+id/textview1" android:textappearance="?android:attr/textappearancelarge" /> <textview android:id="@+id/datum_prikazivanja_filma" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/naslov" android:layout_alignright="@+id/naslov" android:layout_margintop="10dp" android:layout_below="@+id/naslov" android:textappearance="?android:attr/textappearancelarge" /> <textview android:id="@+id/textview3" android:layout_margintop="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/datum_prikazivanja_filma" android:layout_alignright="@+id/datum_prikazivanja_filma" android:layout_below="@+id/datum_prikazivanja_filma" android:layout_marginbottom="5dp" android:text="glumci:" android:textappearance="?android:attr/textappearancelarge" /> <view android:id="@+id/view" android:layout_alignleft="@+id/textview3" android:layout_alignright="@+id/textview3" android:layout_width="fill_parent" android:layout_height="3dp" android:background="#c0c0c0" android:layout_below="@+id/textview3"/> <linearlayout android:id="@+id/linearlayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_below="@+id/view" android:layout_marginbottom="12dp" android:layout_margintop="6dp" android:orientation="horizontal" > <com.android.volley.toolbox.networkimageview android:id="@+id/image1" android:layout_width="60dp" android:layout_height="60dp" android:layout_margintop="16dp" android:layout_weight="1" android:layout_gravity="center_horizontal" android:scaletype="fitcenter" android:src="@drawable/ic_horor_filmovi_ikonica" /> <com.android.volley.toolbox.networkimageview android:id="@+id/image2" android:src="@drawable/ic_horor_filmovi_ikonica" android:layout_margintop="16dp" android:layout_weight="1" android:layout_gravity="center_horizontal" android:scaletype="fitcenter" android:layout_width="60dp" android:layout_height="60dp"/> <com.android.volley.toolbox.networkimageview android:id="@+id/image3" android:src="@drawable/ic_horor_filmovi_ikonica" android:layout_margintop="16dp" android:layout_weight="1" android:layout_gravity="center_horizontal" android:scaletype="fitcenter" android:layout_width="60dp" android:layout_height="60dp"/> </linearlayout> <linearlayout android:id="@+id/linearlayouttextview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/linearlayout" android:orientation="horizontal"> <textview android:id="@+id/ime1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="20sp" android:textcolor="@color/black" android:layout_weight="1" android:gravity="center" android:text="ime" /> <textview android:id="@+id/ime2" android:textsize="20sp" android:textcolor="@color/black" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="ime" /> <textview android:id="@+id/ime3" android:textsize="20sp" android:textcolor="@color/black" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:text="ime" /> </linearlayout> <view android:id="@+id/view2" android:layout_width="fill_parent" android:layout_height="3dp" android:background="#c0c0c0" android:layout_below="@+id/linearlayouttextview"/> <textview android:id="@+id/textview4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/view2" android:layout_alignright="@+id/view2" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_below="@+id/view2" android:layout_margintop="18dp" android:text="opis filma:" android:textappearance="?android:attr/textappearancelarge" /> <textview android:id="@+id/opisfilma" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_alignleft="@+id/textview4" android:layout_alignright="@+id/textview4" android:gravity="center_vertical" android:layout_below="@+id/textview4" android:layout_margintop="5dp" android:text="textview" android:textcolor="@color/black" android:textsize="20sp"/> </relativelayout> </scrollview> <button android:id="@+id/watch_trailer" android:background="@drawable/dugme_trailer_selector" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:textcolor="@color/white" android:text="pogledaj trailer" /> </relativelayout>
i think problem here android:layout_height="4000dp". scrollview content doesn't need scroll because doesn't take more 4000dp
try changing match_parent
update 2
change this
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true" android:orientation="vertical" android:scrollbars="none"> <relativelayout android:id="@+id/relativelayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:background="@drawable/url">
Comments
Post a Comment