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

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

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

TextView.requestFocus介绍

暂无

代码示例

代码示例来源:origin: TommyLemon/APIJSON

@Override
  public void onClick(View v) {
    tv.setText("");
    tv.requestFocus();
  }
});

代码示例来源:origin: TommyLemon/Android-ZBLibrary

@Override
  public void onClick(View v) {
    tv.setText("");
    tv.requestFocus();
  }
});

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

public void onValidationFailed(View failedView, Rule<?> failedRule) {
  if (failedView instanceof Checkable) {
    Toast.makeText(this, failedRule.getFailureMessage(), Toast.LENGTH_SHORT).show();
  } else if (failedView instanceof TextView) {
    TextView view = (TextView) failedView;
    view.requestFocus();
    view.setError(failedRule.getFailureMessage());
  }
}

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
  public void run() {
    if(resultTextView!=null && resultTextView.getTag().equals(tag)) {
      resultTextView.append(resultString);
      resultTextView.requestFocus();
    }
  }
}

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

TextView nextField = (TextView)currentField.focusSearch(View.FOCUS_RIGHT);
nextField.requestFocus();

代码示例来源:origin: AriesHoo/UIWidget

@Override
  public void onFocusChange(View v, boolean hasFocus) {
    if (!hasFocus && mTitleMainTextMarquee) {
      mTvTitleMain.requestFocus();
    }
  }
});

代码示例来源:origin: AriesHoo/UIWidget

@Override
  public void onFocusChange(View v, boolean hasFocus) {
    if (!hasFocus && mTitleSubTextMarquee) {
      mTvTitleMain.requestFocus();
    }
  }
});

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

final TextView TVLarghezza = (TextView) view.findViewById(R.id.larghezza);
TVLarghezza.post(new Runnable() {
    @Override
    public void run() {
      TVLarghezza.requestFocus();
      InputMethodManager imgr = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
      imgr.showSoftInput(TVLarghezza, InputMethodManager.SHOW_IMPLICIT);
      }
    });

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

final TextView textView = findViewById(R.id.textView);

button.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
    textView.setText("Some text");
    textView.requestFocus();
  }
});

代码示例来源:origin: ShuKeW/TVRecyclerViewAndFocus

@Override public void onFocusChange(View v, boolean hasFocus) {
    Log.d(TAG, "onFocusChange  tabContent");
    if (hasFocus) {
      tabs.get(viewPager.getCurrentItem()).requestFocus();
    }
  }
});

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

// Get the first component and make sure it is focusable. Note you have to use setFocusableInTouchMode and not setFocusable for this to work.
TextView v = (TextView) view.findViewById(R.id.first_component_in_view);
v.setFocusableInTouchMode(true);
v.requestFocus();

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

TextView text2 = (TextView) findViewById(R.id.textView1);
 Button button2 = (Button) findViewById(R.id.button2);
 button2.setOnClickListener(new OnClickListener(){
   public void onClick(View v) {
     text2.setFocusable(true);
     text2.requestFocus(); 
   }
 });

代码示例来源:origin: easefun/polyv-android-sdk-2.0-demo

private void initView() {
  initPopupWindow();
  PolyvCoursesInfo.Course course = getArguments().getParcelable("course");
  String title = "";
  if (course != null)
    title = course.title;
  tv_title.setText(title);
  tv_title.requestFocus();
  iv_finish.setOnClickListener(this);
  iv_share.setOnClickListener(this);
}

代码示例来源:origin: ImangazalievM/ReActiveAndroid

private void onLeftButtonClick() {
  if (isOpen()) {
    close();
  } else {
    folderName.requestFocus();
    AppUtils.showSoftKeyboard(folderName);
  }
}

代码示例来源:origin: fire3/sailorcast

@Override
  public void onClick(View v) {
    mVideoClose.requestFocus();
    mVideoClose.setPressed(true);
    mVideoTitle.requestFocus();
    mVideoTitle.setPressed(true);
    finish();
  }
});

代码示例来源:origin: AriesHoo/UIWidget

@Override
protected void onResume() {
  mAgentWeb.getWebLifeCycle().onResume();
  super.onResume();
  if (titleBar != null) {
    titleBar.getTextView(Gravity.CENTER | Gravity.TOP).requestFocus();
  }
}

代码示例来源:origin: ImangazalievM/ReActiveAndroid

private void onRightButtonClick() {
  if (isOpen()) {
    apply();
    close();
  } else {
    folderName.requestFocus();
    AppUtils.showSoftKeyboard(folderName);
  }
}

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

// make the title scroll!
// find the title TextView

TextView title = (TextView) findViewById(android.R.id.title);
// set the ellipsize mode to MARQUEE and make it scroll only once
title.setEllipsize(TruncateAt.MARQUEE);
title.setMarqueeRepeatLimit(1);
// in order to start strolling, it has to be focusable and focused
title.setFocusable(true);
title.setFocusableInTouchMode(true);
title.requestFocus();

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

// make the title scroll!
    // find the title TextView
    TextView title = (TextView) findViewById(android.R.id.title);
    // set the ellipsize mode to MARQUEE and make it scroll only once
    title.setEllipsize(TruncateAt.MARQUEE);
    title.setMarqueeRepeatLimit(1);
    // in order to start strolling, it has to be focusable and focused
    title.setFocusable(true);
    title.setFocusableInTouchMode(true);
    title.requestFocus();

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

this.setTitle("my title!");
((TextView)v.findViewById(R.id.title)).setText(this.getTitle());
TextView title = ((TextView)v.findViewById(R.id.title));
title.setEllipsize(TextUtils.TruncateAt.MARQUEE);
title.setMarqueeRepeatLimit(1);
// in order to start strolling, it has to be focusable and focused
title.setFocusable(true);
title.setSingleLine(true);
title.setFocusableInTouchMode(true);
title.requestFocus();

相关文章

微信公众号

最新文章

更多

TextView类方法