本文整理汇总了Java中android.widget.EditText.setVerticalScrollBarEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java EditText.setVerticalScrollBarEnabled方法的具体用法?Java EditText.setVerticalScrollBarEnabled怎么用?Java EditText.setVerticalScrollBarEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.EditText
的用法示例。
在下文中一共展示了EditText.setVerticalScrollBarEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import android.widget.EditText; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
clickHandler = new ClickHandler(this);
txtDialogTitle = (TextView) view.findViewById(R.id.txtDialogTitle);
txtContent = (TextView) view.findViewById(R.id.txtContent);
btnOk = (TextView) view.findViewById(R.id.btnOk);
btnExit = (TextView) view.findViewById(R.id.btnExit);
btnCancel = (TextView) view.findViewById(R.id.btnCancel);
edtLibName = (EditText) view.findViewById(R.id.edtLibName);
btnOk.setOnClickListener(clickHandler);
btnExit.setOnClickListener(clickHandler);
btnCancel.setOnClickListener(clickHandler);
txtContent.setText(content);
btnOk.setText(ok);
btnCancel.setText(cancel);
btnExit.setText(exit);
if (!TextUtils.isEmpty(sDialogTitle)) {
txtDialogTitle.setText(sDialogTitle);
}
if (btnCount == 1) {
btnCancel.setVisibility(View.GONE);
} else if (btnCount == 3) {
btnExit.setVisibility(View.VISIBLE);
}
int visibility = hasEditText ? View.VISIBLE : View.GONE;
edtLibName.setVisibility(visibility);
if (!TextUtils.isEmpty(textContent)) {
edtLibName.setText(textContent);
}
if (!TextUtils.isEmpty(hintText)) {
edtLibName.setHint(hintText);
}
if (isMultiLineEditText) {
edtLibName.setMaxLines(1);
edtLibName.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);
edtLibName.setScroller(new Scroller(getContext()));
edtLibName.setVerticalScrollBarEnabled(true);
edtLibName.setMovementMethod(new ScrollingMovementMethod());
}
}