以下是我試圖實現的佈局xml的代碼,我不知道它背後的問題有誰能幫助我嗎?不滾動 ScrollView不滾動裏面linearlayout android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/activity_post"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:weightSum="1">
<ScrollView
android:fillViewport="true"
android:layout_weight="0.95"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
tools:ignore="NestedWeights"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_weight="0.05"
tools:ignore="NestedWeights"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp">
<TextView
tools:ignore="NestedWeights"
android:id="@+id/etSearch"
android:maxLines="1"
android:layout_weight="0.9"
android:gravity="center"
android:padding="@dimen/value_3"
android:textColor="@color/black"
android:layout_width="0dp"
android:textSize="@dimen/font_14"
android:background="@drawable/bg"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/search_text"/>
<FrameLayout
android:background="@drawable/tab_bg_selector"
android:id="@+id/imgChat"
tools:ignore="NestedWeights"
android:layout_gravity="center"
android:layout_weight="0.1"
android:layout_margin="@dimen/value_5"
android:layout_width="0dp"
android:layout_height="@dimen/value_30">
<TextView
android:gravity="center"
android:id="@+id/msgCount"
android:textSize="@dimen/font_14"
android:textColor="@android:color/white"
android:background="@drawable/round"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="@dimen/value_20" />
<ImageView
android:visibility="gone"
android:id="@+id/imgMsg"
android:src="@drawable/chatt"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
</LinearLayout>
<!--<LinearLayout />-->
<LinearLayout
android:layout_weight="0.9"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:descendantFocusability="blocksDescendants"
tools:ignore="NestedWeights"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<LinearLayout
android:orientation="vertical"
android:background="@color/rv_color"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
tools:ignore="NestedWeights"
android:layout_centerInParent="true"
android:id="@+id/rvHairList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false" />
</LinearLayout>
<ProgressBar
android:indeterminateTint="@color/user_name"
android:id="@+id/main_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<include
layout="@layout/error_layout"/>
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_weight="0.05"
android:gravity="bottom"
android:layout_gravity="bottom"
android:background="@color/white"
tools:ignore="NestedWeights"
android:padding="@dimen/value_5"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/llDrawer"
android:gravity="center"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/drawer"
android:layout_gravity="center"
tools:ignore="NestedWeights"
android:layout_marginRight="@dimen/value_5"
android:layout_marginLeft="@dimen/value_5"
android:layout_width="@dimen/value_30"
android:layout_height="@dimen/value_20"
android:src="@drawable/more"/>
</LinearLayout>
<LinearLayout
android:id="@+id/llHome"
android:gravity="center"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imgHome"
android:layout_gravity="center"
tools:ignore="NestedWeights"
android:layout_marginRight="@dimen/value_5"
android:layout_marginLeft="@dimen/value_5"
android:layout_width="@dimen/value_30"
android:layout_height="@dimen/value_20"
android:src="@drawable/home"/>
</LinearLayout>
<FrameLayout
android:id="@+id/imgFriendRequest"
tools:ignore="NestedWeights"
android:layout_gravity="center"
android:layout_weight="1"
android:layout_marginRight="@dimen/value_5"
android:layout_marginLeft="@dimen/value_5"
android:layout_width="@dimen/value_30"
android:layout_height="@dimen/value_20">
<TextView
android:gravity="center"
android:id="@+id/friendCount"
android:textSize="@dimen/font_14"
android:textColor="@android:color/white"
android:background="@drawable/round"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:visibility="gone"
android:id="@+id/imgFnd"
android:src="@drawable/add_friend"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
<LinearLayout
android:visibility="gone"
android:gravity="center"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/gestureImg"
android:layout_gravity="center"
tools:ignore="NestedWeights"
android:layout_marginRight="@dimen/value_5"
android:layout_marginLeft="@dimen/value_5"
android:layout_width="@dimen/value_30"
android:layout_height="@dimen/value_20"
android:src="@drawable/img_thing"/>
</LinearLayout>
<LinearLayout
android:id="@+id/llNewPost"
android:gravity="center"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imgGallery"
android:layout_gravity="center"
tools:ignore="NestedWeights"
android:layout_marginRight="@dimen/value_5"
android:layout_marginLeft="@dimen/value_5"
android:layout_width="@dimen/value_30"
android:layout_height="@dimen/value_20"
android:src="@drawable/gallery"/>
</LinearLayout>
<FrameLayout
android:id="@+id/imgNotification"
tools:ignore="NestedWeights"
android:layout_gravity="center"
android:layout_weight="1"
android:layout_marginRight="@dimen/value_5"
android:layout_marginLeft="@dimen/value_5"
android:layout_width="@dimen/value_30"
android:layout_height="@dimen/value_20">
<TextView
android:gravity="center"
android:id="@+id/notiCount"
android:textSize="@dimen/font_14"
android:textColor="@android:color/white"
android:background="@drawable/round"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:visibility="gone"
android:id="@+id/imgNoti"
android:src="@drawable/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
<LinearLayout
android:id="@+id/llProfile"
android:gravity="center"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<de.hdodenhof.circleimageview.CircleImageView
android:layout_gravity="center"
android:layout_weight="1"
tools:ignore="NestedWeights"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/imgTimeline"
android:layout_width="@dimen/value_30"
android:layout_height="@dimen/value_20"
android:src="@drawable/loader"
android:layout_marginRight="@dimen/value_5"
android:layout_marginLeft="@dimen/value_5"
app:civ_border_color="#FF000000"/>
</LinearLayout>
</LinearLayout>
滾動型我曾試圖改變滾動型的滾動型和LinearLayout中的高度,但沒有得到任何解決方案
使用嵌套的滾動視圖 –
我已經嘗試過了,但沒有發現變化 –
@JaydeepPatel嵌套滾動進行滾動recyclerview –