TextView textView = new TextView(this); ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, 100); textView.setText("测试"); textView.setTextSize(24); suggestionContainerLinearLayout.addView(textView, layoutParams);