Android:textviews数组 [英] Android: array of textviews

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

问题描述

我正在制作一个应用程序,在该应用程序中我想从字符串数组中更改textviews的文本.为此,我需要制作textviews的数组.如何做到这一点?有人可以帮我吗

I am making an app in which I want to change the text of textviews from an array of strings. For that I need to make the array of textviews.How to do that?? Can anyone help me over this

推荐答案

您可以这样创建TextView:

You can create TextViews like this:

int textViewCount = 10;

TextView[] textViewArray = new TextView[textViewCount];

for(int i = 0; i < textViewCount; i++) {
   textViewArray[i] = new TextView(this);
}

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

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