展会信息港展会大全

android自定义 ListView 圆角
来源:互联网   发布日期:2015-11-26 09:32:42   浏览:2124次  

导读:android自定义 ListView 圆角1.[代码][Java]代码 String[] mStrings = { aaaa, bbbb, cccc };ListView listView = (ListView) findViewById(R.id.list);listView.setAdapter(new ArrayAdap......

android自定义 ListView 圆角

1. [代码][Java]代码

String[] mStrings = { "aaaa", "bbbb", "cccc" };

ListView listView = (ListView) findViewById(R.id.list);

listView.setAdapter(new ArrayAdapter<String>(this,

android.R.layout.simple_list_item_1, mStrings));

2. [代码][XML]代码

<ListView android:id="@+id/list" android:layout_width="fill_parent"

android:layout_height="wrap_content" android:background="@layout/list_corner_1"

android:layout_weight="1.0" />

3. [代码][XML]代码

<?xml version="1.0" encoding="UTF-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"

android:shape="rectangle">

<gradient android:startColor="#CCCCFF" android:endColor="#99CCFF"

android:angle="90" />

<corners android:bottomRightRadius="10dp"

android:bottomLeftRadius="10dp" android:topLeftRadius="10dp"

android:topRightRadius="10dp" />

</shape>

赞助本站

人工智能实验室

相关热词: ListView 圆角

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港