Android listview项底部的Progressbar
Progressbar有android:layout\u alignParentBottom=“true”,但它不在底部 我怎样才能使进度条在底部,我的意思是在分隔器的顶部 更新:我在Listview中添加了分隔符属性:Android listview项底部的Progressbar,android,progress-bar,Android,Progress Bar,Progressbar有android:layout\u alignParentBottom=“true”,但它不在底部 我怎样才能使进度条在底部,我的意思是在分隔器的顶部 更新:我在Listview中添加了分隔符属性: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_he
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@id/explorer_fIcon"
android:layout_width="50dp"
android:layout_height="50dp"
android:contentDescription="@null"
android:padding="3dp" />
<TextView
android:id="@id/explorer_fName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="40dp"
android:layout_toRightOf="@id/explorer_fIcon"
android:ellipsize="marquee"
android:singleLine="true"
android:textStyle="bold" />
<CheckBox
android:id="@id/explorer_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:clickable="false"
android:focusable="false"
android:visibility="gone" />
<ProgressBar
android:id="@+id/drawer_progressbar2"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clickable="false"
android:progress="40" />
</RelativeLayout>
但它仍然不起作用
更新2:非常感谢。以下是我从u得到的最终答案:
<ListView
android:id="@+id/left_drawer_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:fastScrollEnabled="false" />
1.在浏览器图标下方调整进度条,并从顶部将其留一点边距 2.现在在Listview上,隐藏分隔符,并将分隔符高度设置为0px 3.现在你的进度条应该像一个分隔符
它应该可以工作,让我知道它是否工作。您可以尝试其他方法,使分隔符显示。在父列表视图中添加:
<ProgressBar
android:id="@+id/drawer_progressbar2"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/explorer_fIcon"
android:layout_marginBottom="-7dp"
android:clickable="false"
android:progress="40"
android:visibility="visible" />
ProgressBar
是一个视图,其中包含一个容器,该容器具有额外的填充事件,其高度设置为wrap\u content
。因此,我认为除了给它一个负的利润率之外,没有别的办法
android:dividerHeight="0dp"
所以,像这样改变你的进度条
android:layout_marginBottom="-7dp"
应该有用。太棒了,对我来说真的很有用。非常感谢你。
<ProgressBar
android:id="@id/drawer_progressbar2"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="-7dp"
android:layout_alignParentBottom="true"
android:clickable="false"
android:progress="40" />