android.widget.TextView.setVerticalScrollBarEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中android.widget.TextView.setVerticalScrollBarEnabled()方法的一些代码示例,展示了TextView.setVerticalScrollBarEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setVerticalScrollBarEnabled()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setVerticalScrollBarEnabled

TextView.setVerticalScrollBarEnabled介绍

暂无

代码示例

代码示例来源:origin: czy1121/update

TextView tv = new TextView(mContext);
tv.setMovementMethod(new ScrollingMovementMethod());
tv.setVerticalScrollBarEnabled(true);
tv.setTextSize(14);
tv.setMaxHeight((int) (250 * density));

代码示例来源:origin: stackoverflow.com

// try this
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical">

</LinearLayout>

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    TextView textView = new TextView(this);
    textView.setText("demotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotextdemotext");
    textView.setVerticalScrollBarEnabled(true);
    textView.setLines(3);
    textView.setMovementMethod(new ScrollingMovementMethod());

    addContentView(textView,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}

代码示例来源:origin: stackoverflow.com

AlertDialog dialog = new AlertDialog.Builder(this)
       .setTitle("YOUR_TITLE")
       .setMessage("YOUR_MSG")
       .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
         public void onClick(DialogInterface dialog, int which) {
           dialog.dismiss();
         }
       })
       .setIcon(android.R.drawable.ic_dialog_info)
       .show();
   TextView textView = (TextView) dialog.findViewById(android.R.id.message);
   textView.setMaxLines(5);
   textView.setScroller(new Scroller(this));
   textView.setVerticalScrollBarEnabled(true);
   textView.setMovementMethod(new ScrollingMovementMethod());

代码示例来源:origin: luckybilly/DebugController

textView.setPadding(10, 10, 10, 10);
textView.setMovementMethod(ScrollingMovementMethod.getInstance());
textView.setVerticalScrollBarEnabled(true);
textView.setHorizontalScrollBarEnabled(true);
textView.setHorizontallyScrolling(true);

代码示例来源:origin: marzika/Snapprefs

TextView colors = new TextView(context);
colors.setMaxLines(20);
colors.setVerticalScrollBarEnabled(true);

代码示例来源:origin: stackoverflow.com

mOutputText.setLayoutParams(tlp);
mOutputText.setPadding(16, 16, 16, 16);
mOutputText.setVerticalScrollBarEnabled(true);
mOutputText.setMovementMethod(new ScrollingMovementMethod());
activityLayout.addView(mOutputText);

相关文章

TextView类方法