0

我试图允许用户在使用 ListViews 的应用程序中设置字体大小。如何从数据库中获取字体大小并使用它来设置列表视图中的文本大小?

编辑:例子会很好:)

4

3 回答 3

1
  1. 使用选择查询从数据库中获取字体大小。
  2. 在 listview 的 listview 中设置 textview 的字体大小;使用 textview.setTextSize(int,float);s getview 方法;
于 2011-09-02T10:20:46.503 回答
1

要访问数据库,请在此处查看示例:http: //www.devx.com/wireless/Article/40842/1954

为了改变 listview 的 textview 的文本大小,你应该在 listview 的适配器的 getView() 中设置这个字体大小。

希望这可以帮助!

于 2011-09-02T10:21:41.340 回答
0

It's so easy,first you make sure that you can receive textSize from database.second you must find the text from listview item,in method OnItemClick() you can get the view which clicked, and then use View.findviewbyid() to find out which view you want set the textsize,then use getText() method to receive text what you want to change, in the end you maybe call method notifyDataSetChanged().

于 2011-09-02T10:28:06.247 回答