public class MainActivity extends Activity {
private TextView textView;
RelativeLayout.LayoutParams params;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
textView = new TextView(this);
RelativeLayout layout = new RelativeLayout(this);
params = new RelativeLayout.LayoutParams(100,LayoutParams.WRAP_CONTENT);
textView.setBackgroundColor(Color.parseColor("#43d5bf"));
textView.setSingleLine(true);
textView.setEllipsize(TruncateAt.END);
textView.setLines(1);
textView.setClickable(true);
textView.setTextSize(20);
textView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
textView.setText("dwecedvknewjneirlgeiurgekjfnksfwefweincwefuenuiebvieb胜");
}
});
textView.setLayoutParams(params);
textView.setText("ffssssssssssssssssssssssssssssss");
layout.addView(textView);
setContentView(layout);
}
}
textView.setText("ffssssssssssssssssssssssssssssss");这行代码运行时超出部分以"."结尾但 是点击设置内容包含中文超出部分就是以"..."结尾,请问各位如何设置才能以设置内容不包含中文也以"..."结尾??
加上
textView.setHorizontallyScrolling(false);就可以了,不过这是为什么?