【发布时间】:2016-08-13 04:02:40
【问题描述】:
如何从字符串中计算字符和单词以在 android 中插入换行符
我有一个包含最多 150 个字母的单词的文本输出,并且希望所有 50 个字母都带有一个换行符而不分隔单词。 我该如何实施? 这是一个代码 sn -p ....
ll = (TableLayout) rootview.findViewById(R.id.displayLinear);
TableRow row = new TableRow(getActivity());
consoleLocalStore.storeConsoleData(consolex);
LayoutInflater inflater = getLayoutInflater(getArguments());
View theInflatedView = inflater.inflate(R.layout.activity_consolex,
null);
TextView attid = (TextView) theInflatedView.findViewById(R.id.output);
attid.setText(String.valueOf(consolex.output));
attid = new TextView(getActivity());
row.addView(attid);
row.setGravity(Gravity.CENTER_HORIZONTAL);
row.addView(theInflatedView);
ll.addView(row, i);
【问题讨论】:
标签: android count words letters