本文整理了Java中android.widget.TextView.setMarqueeRepeatLimit()
方法的一些代码示例,展示了TextView.setMarqueeRepeatLimit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setMarqueeRepeatLimit()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setMarqueeRepeatLimit
暂无
代码示例来源:origin: mightyfrog/marqueetoolbar
private void initTitleMarquee() {
if (!mTitleMarqueeEnabled) {
return;
}
try {
Field field = Toolbar.class.getDeclaredField("mTitleTextView");
field.setAccessible(true);
mTitleTextView = (TextView) field.get(this);
mTitleTextView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
mTitleTextView.setMarqueeRepeatLimit(mRepeatTitle);
} catch (Exception e) {
// NoSuchFieldException, IllegalAccessException shadowed
}
}
代码示例来源:origin: mightyfrog/marqueetoolbar
private void initSubtitleMarquee() {
if (!mSubtitleMarqueeEnabled) {
return;
}
try {
Field field = Toolbar.class.getDeclaredField("mSubtitleTextView");
field.setAccessible(true);
mSubtitleTextView = (TextView) field.get(this);
mSubtitleTextView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
mSubtitleTextView.setMarqueeRepeatLimit(mRepeatSubtitle);
} catch (Exception e) {
// NoSuchFieldException, IllegalAccessException shadowed
}
}
}
代码示例来源:origin: stackoverflow.com
TextView tt = (TextView) v.findViewById(R.id.txtArticleTitle);
tt.setEllipsize(TruncateAt.MARQUEE);
tt.setMarqueeRepeatLimit(1);
代码示例来源:origin: stackoverflow.com
TextView txt = new TextView(this);
txt.setText("This is the infinite marquee");
txt.setEllipsize(TextUtils.TruncateAt.MARQUEE);
txt.setSingleLine(true);
txt.setMarqueeRepeatLimit(-1);
txt.setSelected(true);
代码示例来源:origin: stackoverflow.com
TextView txt = new TextView(this);
txt.setText(“This is moving text”);
txt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
txt.setTextColor(Color.rgb(187, 88, 15));
txt.setPadding(10, 10, 0, 0);
txt.setEllipsize(TruncateAt.MARQUEE);
txt.setSingleLine();
txt.setMarqueeRepeatLimit(10);
txt.setFocusable(true);
txt.setHorizontallyScrolling(true);
txt.setFocusableInTouchMode(true);
txt.requestFocus();
txt.setLayoutParams(new TableRow.LayoutParams(130, TableRow.LayoutParams.FILL_PARENT));
txt.setTypeface(Typeface.SERIF,Typeface.BOLD);
代码示例来源:origin: stackoverflow.com
TextView txt = new TextView(this);
txt.setText(“This is moving text”);
txt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
txt.setTextColor(Color.rgb(187, 88, 15));
txt.setPadding(10, 10, 0, 0);
txt.setEllipsize(TruncateAt.MARQUEE);
txt.setSingleLine();
txt.setMarqueeRepeatLimit(10);
txt.setFocusable(true);
txt.setHorizontallyScrolling(true);
txt.setFocusableInTouchMode(true);
txt.requestFocus();
txt.setLayoutParams(new TableRow.LayoutParams(130, TableRow.LayoutParams.FILL_PARENT));
txt.setTypeface(Typeface.SERIF,Typeface.BOLD);
代码示例来源:origin: stackoverflow.com
TextView text_view = new TextView(context);
text_view.setLines(1);
text_view.setHorizontallyScrolling(true);
text_view.setMarqueeRepeatLimit(-1); // At this point the view is not scrolling!
...
text_view.setSelected(true); // Get scrolling to start
代码示例来源:origin: PrivacyApps/document-viewer
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent)
{
final ViewHolder holder = BaseViewHolder.getOrCreateViewHolder(ViewHolder.class, R.layout.list_dropdown_item,
convertView, parent);
holder.textView.setSingleLine();
holder.textView.setMarqueeRepeatLimit(-1);
holder.textView.setText(getItem(position));
return holder.getView();
}
代码示例来源:origin: stackoverflow.com
int titleId = Resources.getSystem().
getIdentifier("action_bar_title", "id", "android");
if(titleId==0)
titleId=com.actionbarsherlock.R.id.abs__action_bar_title;
TextView mApptitle=(TextView)findViewById(titleId);
mApptitle.setEllipsize(TruncateAt.MARQUEE);
mApptitle.setMarqueeRepeatLimit(1);
mApptitle.setFocusable(true);
mApptitle.setFocusableInTouchMode(true);
mApptitle.requestFocus();
mApptitle.setSingleLine(true);
mApptitle.setSelected(true);
mApptitle.setMarqueeRepeatLimit(-1);
代码示例来源:origin: stackoverflow.com
TextView tv = new TextView(this);
rl.addView(tv);// Here is Your Mistake ! Remove it
tv.setLayoutParams(paramsSong);
tv.setEllipsize(TruncateAt.MARQUEE);
tv.setFocusableInTouchMode(true);
tv.setFreezesText(true);
tv.setSingleLine(true);
tv.setMarqueeRepeatLimit(-1);
tv.setText("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
tv.setSelected(true);
rl.addView(tv);// Adding view Here is Absolutely Right !
DigitalClock dg = new DigitalClock(this);
dg.setHeight(setHeightHere);
dg.setWidth(setWidthHere);
rl.addView(dg);
代码示例来源:origin: stackoverflow.com
textrootname.setFocusableInTouchMode(true);
textrootname.setFreezesText(true);
textrootname.setMarqueeRepeatLimit(-1);
textrootname.setFocusable(true);
textrootname.setSelected(true);
代码示例来源:origin: stackoverflow.com
TextView textView=(TextView)findViewById(R.id.text_test);
textView .setEllipsize(TextUtils.TruncateAt.MARQUEE);
textView .setSingleLine(true);
textView .setMarqueeRepeatLimit(-1);
textView.setFocusableInTouchMode(true);
textView.setFocusable(true);
代码示例来源:origin: stackoverflow.com
TextView titleTextView = null;
try {
Field f = toolbar.getClass().getDeclaredField("mTitleTextView");
f.setAccessible(true);
titleTextView = (TextView) f.get(toolbar);
titleTextView.setEllipsize(TruncateAt.MARQUEE);
titleTextView.setFocusable(true);
titleTextView.setFocusableInTouchMode(true);
titleTextView.requestFocus();
titleTextView.setSingleLine(true);
titleTextView.setSelected(true);
titleTextView.setMarqueeRepeatLimit(-1);
} catch (NoSuchFieldException e) {
} catch (IllegalAccessException e) {
}
代码示例来源: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: DingMouRen/DingDingMap
if (ellipsize == TextUtils.TruncateAt.MARQUEE) {
text.setSingleLine(true);
text.setMarqueeRepeatLimit(-1);
text.setHorizontallyScrolling(true);
text.setFocusable(true);
代码示例来源:origin: DingMouRen/DingDingMap
if (subEllipsize == TextUtils.TruncateAt.MARQUEE) {
subText.setSingleLine(true);
subText.setMarqueeRepeatLimit(-1);
subText.setHorizontallyScrolling(true);
subText.setFocusable(true);
代码示例来源: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();
代码示例来源:origin: stackoverflow.com
textView1.setSelected(true);
textView1.setEllipsize(TextUtils.TruncateAt.MARQUEE);
textView1.setMarqueeRepeatLimit(-1);
textView2.setSelected(true);
textView2.setEllipsize(TextUtils.TruncateAt.MARQUEE);
textView2.setMarqueeRepeatLimit(-1);
代码示例来源:origin: samlss/TimoMenu
private void initTextView(){
setNormalTextState();
mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTimoItemViewParameter.getTextSize());
mTextView.setEllipsize(mTimoItemViewParameter.getEllipsize());
mTextView.setGravity(Gravity.CENTER);
if (mTimoItemViewParameter.getEllipsize() == null
|| mTimoItemViewParameter.getEllipsize() == TextUtils.TruncateAt.MARQUEE) {
mTextView.setSingleLine(true);
mTextView.setMarqueeRepeatLimit(-1);
mTextView.setHorizontallyScrolling(true);
mTextView.setFocusable(true);
mTextView.setFocusableInTouchMode(true);
mTextView.setFreezesText(true);
}
LayoutParams layoutParams = new LayoutParams(mTimoItemViewParameter.getTextWidth(), mTimoItemViewParameter.getTextHeight());
if (mTimoItemViewParameter.getTextMargin() != null) {
layoutParams.leftMargin = mTimoItemViewParameter.getTextMargin().left;
layoutParams.topMargin = mTimoItemViewParameter.getTextMargin().top;
layoutParams.rightMargin = mTimoItemViewParameter.getTextMargin().right;
layoutParams.bottomMargin = mTimoItemViewParameter.getTextMargin().bottom;
}
if (mTimoItemViewParameter.getTextPadding() != null) {
mTextView.setPadding(mTimoItemViewParameter.getTextPadding().left,
mTimoItemViewParameter.getTextPadding().top,
mTimoItemViewParameter.getTextPadding().right,
mTimoItemViewParameter.getTextPadding().bottom);
}
addView(mTextView, layoutParams);
}
内容来源于网络,如有侵权,请联系作者删除!