:1:首先xml布局先布局成scrollView可拖拽
2:通過(guò)一下方法
public String getFromAssets(String fileName) {
String Result = "";
InputStreamReader inputReader = null;
BufferedReader bufReader = null;
try {
inputReader = new InputStreamReader(getResources().getAssets()
.open(fileName));
bufReader = new BufferedReader(inputReader);
String line = "";
while ((line = bufReader.readLine()) != null) {
Result += line;
Result += "\n";
}
return Result;
} catch (Exception e) {
e.printStackTrace();
} finally {
if (bufReader != null && inputReader != null) {
try {
bufReader.close();
inputReader.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
return Result;
}
3:設(shè)置調(diào)用