я потратил достаточно времени, чтобы заставить его работать на моей ListView к SetProperty «above
» макета, который align_parentBottom=true.
Как установить listview в исходное положение?
кажется, очень легко не так ли? Нет, это не так.
Пожалуйста, взгляните на это изображение, чтобы вы могли визуализировать проблему и иметь представление об этом.
Когда пользователь scrolls listview
, кнопка домой @bottom шкура.
И по умолчанию кнопка «домой» остается такой, какая она есть, если прокрутка списка находится в режиме ожидания. Это нужно сделать.
Так что моя проблема в том, что после домашней кнопки Visibility
идет GONE
того listview
заполняет все пространство по направлению к нижней части означает MATCH_PARENT
, то отлично.
Но когда прокрутка достигает незанятого состояния & Visibility
установлена в Visible
, затем последний элемент списка просматривает идет/скрывается за кнопкой домой.
Это значит, что listview
не доходит до своего первоначального места, поскольку изображения показывают.
Пробужденный программным путем, чтобы установить свойство «выше» списка как Главная кнопка align_parentBottom=true
.
также попытался изменить весь макет на линейную компоновку и дать weight=1
.
Но не удалось. Любая помощь будет оценена.
Спасибо.
Layout Fragement Файл:
<LinearLayout
android:id="@+id/llmain"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<TextView
android:id="@+id/txtTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/d_10"
android:layout_marginTop="@dimen/d_5"
style="@style/text_size_title"
android:textColor="@color/black"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/d_10"
android:layout_marginRight="@dimen/d_10"
android:layout_marginTop="@dimen/d_5">
<TextView
android:id="@+id/txtDateTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/comment_n_time_color_text"
android:textSize="14sp" />
<LinearLayout
android:layout_width="@dimen/d_1"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/d_3"
android:layout_marginRight="@dimen/d_3"
android:background="@color/comment_n_time_color" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_like" />
<TextView
android:id="@+id/txtLike"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/d_3"
android:layout_marginRight="@dimen/d_3"
android:textColor="@color/comment_n_time_color_text"
android:textSize="14sp" />
<LinearLayout
android:layout_width="@dimen/d_1"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/d_3"
android:layout_marginRight="@dimen/d_3"
android:background="@color/comment_n_time_color" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/comment" />
<TextView
android:id="@+id/txtComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/d_3"
android:layout_marginRight="@dimen/d_3"
android:textColor="@color/comment_n_time_color_text"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/article_detail_separator"
android:layout_marginTop="@dimen/d_5"
android:background="@color/comment_n_time_color"></LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/d_10"
android:layout_marginTop="@dimen/d_5"
android:text="@string/article_comment"
android:textAppearance="?android:textAppearanceMedium"
android:textColor="@color/black"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/d_10"
android:layout_marginRight="@dimen/d_10"
android:layout_marginTop="@dimen/d_5"
android:orientation="horizontal">
<EditText
android:id="@+id/txt_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/d_10"
android:layout_weight="1"
android:hint="@string/article_comment_hint"
android:textColor="@color/black" />
<ImageView
android:id="@+id/img_send"
android:padding="@dimen/d_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/send_button" />
</LinearLayout>
<ListView
android:id="@+id/listview_comments"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="@null"
android:listSelector="@null">
</ListView>
</LinearLayout>
И Моя активность Компоновка:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/parent"
android:background="@android:color/white">
<include
android:id="@+id/toolbaar"
layout="@layout/partial_toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_alignParentTop="true" />
<View
android:layout_below="@+id/toolbaar"
android:id="@+id/viewline"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@color/separator_color" />
<FrameLayout
android:layout_above="@+id/llbottom"
android:layout_below="@+id/viewline"
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
<LinearLayout
android:id="@+id/llbottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<include
android:id="@+id/img_home_"
layout="@layout/home_icon_footer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
поделитесь своим файлом макета plz – deniz
опубликуйте свой макет –