NestedScrollView
当我滚动图像时,我在内部使用了一些静态数据,它的工作正常。但是当屏幕尺寸很大时,我的所有数据都适合屏幕,那时我想禁用我的滚动。怎么做。
我的代码
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="250dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
app:layout_collapseMode="parallax"
android:scaleType="centerCrop"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_width="fill_parent"
android:background="#DD000000"
app:layout_collapseMode="parallax"
android:layout_height="fill_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Cafe Noir"
android:layout_gravity="center|left"
android:textAlignment="center"
android:id="@+id/textView34"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="119, 2nd Cross Rd, Phase 4, J P Nagar"
android:textColor="@color/colorsplashDark"
android:layout_gravity="center|left"
android:textAlignment="center"
android:id="@+id/textView35"
android:layout_below="@+id/textView34"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:behavior_overlapTop="64dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="24dp">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight=".3"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView13"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:src="@drawable/checkin_history_time" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight=".1"
android:orientation="vertical">
<TextView
android:id="@+id/placename"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/checkin_history_time"
android:textColor="@android:color/black"
android:textSize="13dp"
android:textStyle="bold" />
<TextView
android:id="@+id/address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:tag="Hover"
android:text="2 hours ago\n (3:15 pm)"
android:textColor="@color/colorSubText"
android:textSize="10dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight=".3"
android:orientation="vertical">
<ImageView
android:id="@+id/pointsimage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:src="@drawable/home_bounty_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight=".1"
android:orientation="vertical">
<TextView
android:id="@+id/pointstitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/checkin_history_points"
android:textColor="@android:color/black"
android:textSize="13dp"
android:textStyle="bold" />
<TextView
android:id="@+id/pointsdesc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:tag="Hover"
android:text="You earned 10 Points for checkin"
android:textColor="@color/colorSubText"
android:textSize="10dp"
android:textStyle="bold" />
<ImageView
android:id="@+id/billimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:padding="10dp"
android:src="@drawable/verify_places_snap_sample" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:drawableLeft="@drawable/checkin_history_uploadbill"
android:drawablePadding="10dp"
android:gravity="center"
android:visibility="gone"
android:layout_gravity="center"
android:text="@string/checkin_history_uploadphoto_warning"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/textSize_home_yourtotal_rewards"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight=".3"
android:orientation="vertical">
<ImageView
android:id="@+id/verificationimage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:src="@drawable/checkin_history_verify" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight=".1"
android:orientation="vertical">
<TextView
android:id="@+id/verifytitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/checkin_history_verification"
android:textColor="@android:color/black"
android:textSize="13dp"
android:textStyle="bold" />
<TextView
android:id="@+id/verifydesc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:tag="Hover"
android:text="Payment SMS verification Successful"
android:textColor="@color/colorSubText"
android:textSize="10dp"
android:textStyle="bold" />
<TextView
android:id="@+id/smstext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:tag="Hover"
android:text="Rs 100 was spent XXXXXXXXXXXXXXXXXXX on 2015-08-27"
android:textColor="@color/capturebill"
android:textSize="10dp"
android:textStyle="italic" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>