嗨,我使用了以下代码:
String displayText = "";
try {
InputStream fileStream = getResources().openRawResource(
R.raw.t);
int fileLen = fileStream.available();
// Read the entire resource into a local byte buffer.
byte[] fileBuffer = new byte[fileLen];
fileStream.read(fileBuffer);
fileStream.close();
displayText = new String(fileBuffer);
} catch (IOException e) {
// exception handling
}
TextView tv=(TextView) findViewById(R.id.textView1);
tv.setText(displayText);
}
它用于显示文本文件。我想改变每条线的颜色(并改变线之间的颜色)我应该怎么做?
我很抱歉说英语不好