Android修改Gallery页面布局

来源:互联网 发布:学籍照片采集软件 编辑:程序博客网 时间:2024/06/03 19:45

Android 实现显示文字的Gallery的基础上,修改了文字的样式,效果如下:

方法如下,增加了布局文件:

<textview xmlns:android="[url=http://schemas.android.com/apk/res/android]http://schemas.android.com/apk/res/android[/url]"     android:id="@android:id/text1"     android:textAppearance="?android:attr/textAppearanceMedium"     android:textColor="#FFFF0000"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:maxLines="1"     android:textSize="30sp" />

然后修改Activity中Adapter,如下:

SpinnerAdapter spinnerAdapter = new SimpleAdapter(this,getData(),                 R.layout.myfont_layout,                 new String[] {"mydata"},new int[] { android.R.id.text1 }); 

 

 

原创粉丝点击