android 分隔线
16lz
2021-12-04
android 分隔线
1.用View 配置文件
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"
android:layout_marginTop="6dip"/>
2.用ImageView 代码
ListView listView=(ListView)findViewById(android.R.id.list);
ImageView iv=new ImageView(this);
iv.setBackgroundDrawable(getResources().getDrawable(R.drawable.list_divider));
listView.addFooterView(iv);
listView.addVerticalFadingEdgeEnabled(false);
listView.addVerticalScrollBarEnabled(true);
list_divider.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#CCCCCC"
android:centerColor="#999999"
android:endColor="#CCCCCC"
android:height="1px"
android:angle="0" />
</shape>
</item>
</layer-list>
1.用View 配置文件
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"
android:layout_marginTop="6dip"/>
2.用ImageView 代码
ListView listView=(ListView)findViewById(android.R.id.list);
ImageView iv=new ImageView(this);
iv.setBackgroundDrawable(getResources().getDrawable(R.drawable.list_divider));
listView.addFooterView(iv);
listView.addVerticalFadingEdgeEnabled(false);
listView.addVerticalScrollBarEnabled(true);
list_divider.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#CCCCCC"
android:centerColor="#999999"
android:endColor="#CCCCCC"
android:height="1px"
android:angle="0" />
</shape>
</item>
</layer-list>
更多相关文章
- 使用Vitamio打造自己的Android万能播放器(1)――准备
- 横竖屏切换 android:screenOrientation属性
- Android(安卓)studio使用笔记。。。
- android和js的相互调用
- Android之增强文本框(TextInputEditText)
- Android中VISIBLE、INVISIBLE、GONE的区别
- android 背景图片
- android 向webview传值
- TextView碉堡了!android源代码的一些统计信息!