小编use*_*688的帖子

android:每行限制10个字符TextView

我从EditText读取值并将其写入TextView

editTitle1.addTextChangedListener(new TextWatcher() {
              public void afterTextChanged(Editable s) {
              }

              public void beforeTextChanged(CharSequence s, int start, int count, int after) {
              }

              public void onTextChanged(CharSequence s, int start, int before, int count) {
                  s = editTitle1.getText().toString();
                  textTitle1.setText(s);

              }
           });
Run Code Online (Sandbox Code Playgroud)

我希望在一行中 - 最多10个字符,所以如果所有20个字符 - 它是TextView中的两行,每行10个字符.我怎么能这样做?我尝试android:maxLength ="10"但它没有帮助

android textview

3
推荐指数
1
解决办法
4366
查看次数

标签 统计

android ×1

textview ×1