Ниже мой макет, пожалуйста, смотрите:
<RelativeLayout 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:clickable="true"
android:focusableInTouchMode="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/view_newsfeed_header_for_nearby"
android:layout_width="match_parent"
android:layout_height="wrap_content"></include>
<fragment
android:id="@+id/mapView"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/rl_near_by_users" />
<TextView
android:id="@+id/txtSearching"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@android:color/white"
android:padding="@dimen/size_6"
android:text="@string/searching"
android:textColor="@color/gray"
android:textSize="@dimen/size_13"
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/relGymData"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_cell_bg"
android:clickable="true"
android:visibility="gone">
<!--android:layout_above="@+id/txtNoResultsFound"-->
<ListView
android:id="@+id/listGymSuggestions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_cell_bg"
android:divider="@null"
android:footerDividersEnabled="false"
android:nestedScrollingEnabled="false"
android:visibility="gone">
</ListView>
<com.ronin.app.custom.SFTextRegularTextView
android:id="@+id/txtNoResultsFound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/listGymSuggestions"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/size_25"
android:padding="@dimen/size_15"
android:text="@string/no_result"
android:textColor="@color/sender_bg"
android:textSize="@dimen/size_16"
android:visibility="gone" />
<ProgressBar
android:id="@+id/progressbar"
style="?android:attr/progressBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/size_30"
android:padding="@dimen/size_20"
android:visibility="gone" />
</RelativeLayout>
Вы можете видеть на приведенном выше макете, который содержит два относительных макета в нем. Я занимаюсь видимостью каждого во время выполнения. Одновременно будет видна только одна относительная компоновка.
Работало нормально. Но,
Проблема в том, что я включил еще один простой макет, используя тег.
Таким образом, My MapView не прокручивается плавно, а ListView также не прокручивается после включения макета с использованием тега .
Вы можете проверить выше XML, как показано ниже:
<include
layout="@layout/**view_newsfeed_header_for_nearby**"
android:layout_width="match_parent"
android:layout_height="wrap_content"></include>
Включен макет, как показано ниже:
view_newsfeed_header_for_nearby
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_near_by_users"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:background="@color/color_nearby_background"
android:clickable="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_nearby_users"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="@dimen/size_5"
android:layout_toLeftOf="@+id/imgNearByNext"
android:layout_toRightOf="@+id/imgNearByPrevious"
android:nestedScrollingEnabled="false"></android.support.v7.widget.RecyclerView>
<com.ronin.app.custom.SFTextRegularTextView
android:layout_centerHorizontal="true"
android:id="@+id/tv_near_by_users"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/rv_nearby_users"
android:layout_marginBottom="@dimen/size_5"
android:layout_toLeftOf="@+id/imgNearByNext"
android:layout_toRightOf="@+id/imgNearByPrevious"
android:clickable="false"
android:ellipsize="end"
android:textColor="@color/white"
android:textSize="@dimen/font_size_11" />
<ImageView
android:id="@+id/imgNearByNext"
style="@style/nextIconView"
android:layout_alignParentRight="true"
android:layout_marginLeft="@dimen/size_5"
android:layout_marginRight="@dimen/size_5" />
<ImageView
android:id="@+id/imgNearByPrevious"
style="@style/previousIconView"
android:layout_marginLeft="@dimen/size_5"
android:layout_marginRight="@dimen/size_5" />
</RelativeLayout>
В чем может быть проблема?