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

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

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

TextView.setPaintFlags介绍

暂无

代码示例

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

TextView someTextView = (TextView) findViewById(R.id.some_text_view);
someTextView.setText(someString);
someTextView.setPaintFlags(someTextView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);

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

TextView tv = (TextView)findViewById(R.id.textViewOne);
tv.setTypeface(null, Typeface.BOLD_ITALIC);
// OR
tv.setTypeface(null, Typeface.BOLD|Typeface.ITALIC);
// OR
tv.setTypeface(null, Typeface.BOLD);
// OR
tv.setTypeface(null, Typeface.ITALIC);
// AND
tv.setPaintFlags(tv.getPaintFlags()|Paint.UNDERLINE_TEXT_FLAG);

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

TextView tv = (TextView) findViewById(R.id.mytext);
tv.setText("This is strike-thru");
tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);

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

TextView tv=(TextView) v.findViewById(android.R.id.text1);
tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);

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

TextView tv = (TextView) findViewById(R.id.mytext);
 tv.setText("This is strike-thru");
 tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);

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

TextView txt = (TextView) findViewById(R.id.Textview1);
txt.setPaintFlags(txt.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

代码示例来源:origin: smuyyh/BookReader

@Override
public EasyRVHolder setTypeface(int viewId, Typeface typeface) {
  TextView view = getView(viewId);
  view.setTypeface(typeface);
  view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  return this;
}

代码示例来源:origin: smuyyh/BookReader

public BaseViewHolder setTypeface(Typeface typeface, int... viewIds) {
  for (int viewId : viewIds) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: smuyyh/BookReader

public BaseViewHolder setTypeface(int viewId, Typeface typeface) {
  TextView view = getView(viewId);
  view.setTypeface(typeface);
  view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  return this;
}

代码示例来源:origin: smuyyh/BookReader

@Override
public EasyLVHolder setTypeface(Typeface typeface, int... viewIds) {
  for (int viewId : viewIds) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: hongyangAndroid/baseAdapter

public ViewHolder setTypeface(Typeface typeface, int... viewIds)
{
  for (int viewId : viewIds)
  {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: smuyyh/BookReader

@Override
public EasyRVHolder setTypeface(Typeface typeface, int... viewIds) {
  for (int viewId : viewIds) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: smuyyh/BookReader

@Override
public EasyLVHolder setTypeface(int viewId, Typeface typeface) {
  TextView view = getView(viewId);
  view.setTypeface(typeface);
  view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  return this;
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

/**
 * 设置字体格式
 * @param viewId
 * @param typeface
 * @return
 */
public BaseAdapterHelper setTypeface(int viewId, Typeface typeface) {
  TextView view = retrieveView(viewId);
  view.setTypeface(typeface);
  view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  return this;
}

代码示例来源:origin: jdsjlzx/LRecyclerView

public RecyclerViewHolder setTypeface(Typeface typeface, int... viewIds) {
  for (int viewId : viewIds) {
    TextView view = findViewById(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: Rukey7/MvpApp

/**
 * Apply the typeface to the given viewId, and enable subpixel rendering.
 */
public BaseViewHolder setTypeface(int viewId, Typeface typeface) {
  TextView view = getView(viewId);
  view.setTypeface(typeface);
  view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  return this;
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

public ViewHolderHelper setTypeface(Typeface typeface, int... viewIds) {
  for (int viewId : viewIds) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: Rukey7/MvpApp

/**
 * Apply the typeface to all the given viewIds, and enable subpixel rendering.
 */
public BaseViewHolder setTypeface(Typeface typeface, int... viewIds) {
  for (int viewId : viewIds) {
    TextView view = getView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

/**
 * 设置字体 给多个控件添加
 * @param typeface
 * @param viewIds
 * @return
 */
public BaseAdapterHelper setTypeface(Typeface typeface, int... viewIds) {
  for (int viewId : viewIds) {
    TextView view = retrieveView(viewId);
    view.setTypeface(typeface);
    view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
  }
  return this;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void getPaintFlagsAndSetPaintFlags_shouldWork() {
 assertThat(textView.getPaintFlags()).isEqualTo(0);
 textView.setPaintFlags(100);
 assertThat(textView.getPaintFlags()).isEqualTo(100);
}

相关文章

TextView类方法