Android 对话框中的文本视图被切断
我以编程方式将textview放在对话框中。文本视图显示文件路径。但文本视图会在文本退出对话框时切断文本Android 对话框中的文本视图被切断,android,textview,Android,Textview,我以编程方式将textview放在对话框中。文本视图显示文件路径。但文本视图会在文本退出对话框时切断文本 TableLayout.LayoutParams tableParams = new TableLayout.LayoutParams( TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.MATCH_PARENT); TableRow.LayoutParams rowParams = new TableRo
TableLayout.LayoutParams tableParams = new TableLayout.LayoutParams(
TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.MATCH_PARENT);
TableRow.LayoutParams rowParams = new TableRow.LayoutParams(
TableRow.LayoutParams.MATCH_PARENT,TableRow.LayoutParams.MATCH_PARENT,1f);
TableLayout table = new TableLayout (context);
table.setLayoutParams(tableParams);
TableRow row = new TableRow(context);
row.setLayoutParams(rowParams);
TextView text = new TextView(context);
TextView textTitle = new TextView(context);
textTitle.setText("File path ");
text.setText(name);
text.setLines(1);
text.setSingleLine(true);
text.setHorizontallyScrolling(true);
text.setEllipsize(TruncateAt.MARQUEE);
row.addView(textTitle);
row.addView(text);
table.addView(row);
使用下面的代码查看显示路径的文本视图
textview.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));