Android的ListView控件TEXTSIZE [英] Android ListView TextSize

查看:164
本文介绍了Android的ListView控件TEXTSIZE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我listview.xml

my listview.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android" xmlns:myapp="http://schemas.android.com/apk/res/zaid.quotes.dlama">
    <ListView android:id="@+id/ListView01" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_alignParentTop="true"
        android:layout_marginBottom="50dp" android:paddingTop="50dp"></ListView>
    <Button android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:id="@+id/Back"
        android:layout_alignParentBottom="true" android:text="Go Back"></Button>

    <LinearLayout android:layout_width="wrap_content"
        android:id="@+id/LinearLayout01" android:layout_height="wrap_content"
        android:layout_alignParentTop="true">
        <com.admob.android.ads.AdView android:id="@+id/ad"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF"
            myapp:secondaryTextColor="#CCCCCC" android:layout_alignParentTop="true" />
    </LinearLayout>


</RelativeLayout>

在ListView文本的当前大小大。而我似乎无法弄清楚如何改变文字大小。

the current size of the text in the listview is large. and i cant seem to figure out how to change the text size.

推荐答案

Yanchenko的回答可以完美运行,如果重命名你的本地 simple_list_item_1.xml

Yanchenko's answer works perfect, if you rename your local simple_list_item_1.xml

MyActivity.java

ArrayAdapter<String> filesAdapter = new ArrayAdapter<String>(this, 
    R.layout.simplest_list_item_1, topFilesArray);
filesList.setDivider(null);

simplest_list_item_1.xml

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textSize="7pt"
    android:paddingLeft="6dip" />

layout_height =WRAP_CONTENT在这里使用了10列表项只。

layout_height="wrap_content" is used here for 10 list items only.

这篇关于Android的ListView控件TEXTSIZE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆