本文整理了Java中android.widget.TextView.requestLayout()
方法的一些代码示例,展示了TextView.requestLayout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.requestLayout()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:requestLayout
暂无
代码示例来源:origin: mancj/MaterialSearchBar
/**
* Set navigation drawer menu icon enabled
*
* @param navButtonEnabled icon enabled
*/
public void setNavButtonEnabled(boolean navButtonEnabled) {
this.navButtonEnabled = navButtonEnabled;
if (navButtonEnabled) {
navIcon.setVisibility(VISIBLE);
navIcon.setClickable(true);
navIcon.getLayoutParams().width = (int) (50 * destiny);
((LayoutParams) inputContainer.getLayoutParams()).leftMargin = (int) (50 * destiny);
arrowIcon.setVisibility(GONE);
} else {
navIcon.getLayoutParams().width = 1;
navIcon.setVisibility(INVISIBLE);
navIcon.setClickable(false);
((LayoutParams) inputContainer.getLayoutParams()).leftMargin = (int) (0 * destiny);
arrowIcon.setVisibility(VISIBLE);
}
navIcon.requestLayout();
placeHolder.requestLayout();
arrowIcon.requestLayout();
}
代码示例来源:origin: TheFinestArtist/FinestWebView-Android
protected void requestCenterLayout() {
int maxWidth;
if (webView.canGoBack() || webView.canGoForward()) {
maxWidth = DisplayUtil.getWidth() - UnitConverter.dpToPx(48) * 4;
} else {
maxWidth = DisplayUtil.getWidth() - UnitConverter.dpToPx(48) * 2;
}
title.setMaxWidth(maxWidth);
urlTv.setMaxWidth(maxWidth);
title.requestLayout();
urlTv.requestLayout();
}
代码示例来源:origin: GitLqr/LQRWeChat
tvName.setVisibility(View.VISIBLE);
ivLogo.requestLayout();
tvName.requestLayout();
llCells[i].setBackgroundResource(cellBack);
llCells[i].setOnClickListener(this);
代码示例来源:origin: chat-sdk/chat-sdk-android
public void setTextHidden (boolean hidden) {
messageTextView.setVisibility(hidden ? View.INVISIBLE : View.VISIBLE);
ConstraintLayout.LayoutParams textLayoutParams = (ConstraintLayout.LayoutParams) messageTextView.getLayoutParams();
if(hidden) {
textLayoutParams.width = 0;
textLayoutParams.height = 0;
}
else {
textLayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
textLayoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
}
messageTextView.setLayoutParams(textLayoutParams);
messageTextView.requestLayout();
messageBubble.requestLayout();
}
代码示例来源:origin: fookwood/Launcher3
@Override
public void requestLayout() {
if (!mDisableRelayout) {
super.requestLayout();
}
}
代码示例来源:origin: klinker24/launcher3
@Override
public void requestLayout() {
if (!mDisableRelayout) {
super.requestLayout();
}
}
代码示例来源:origin: klinker24/Android-Blur-Launcher
@Override
public void requestLayout() {
if (!mDisableRelayout) {
super.requestLayout();
}
}
代码示例来源:origin: enricocid/LaunchEnr
@Override
public void requestLayout() {
if (!mDisableRelayout) {
super.requestLayout();
}
}
代码示例来源:origin: LLhon/Android-Video-Editor
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int value = (Integer) animation.getAnimatedValue();
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
LayoutParams.MATCH_PARENT, value, Gravity.BOTTOM);
tv.setLayoutParams(params);
tv.requestLayout();
}
});
代码示例来源:origin: ssomai/ScalableLayout
public void onClick_SetMoreText(View view) {
TextView tv = (TextView) findViewById(R.id.tv_moretext);
tv.setText(tv.getText() + "커");
tv.requestLayout();
}
代码示例来源:origin: huangweicai/OkLibDemo
public void onAnimationUpdate(ValueAnimator animation) {
Integer value = (Integer) animation.getAnimatedValue();
mConsole.getLayoutParams().width = value.intValue();
mConsole.requestLayout();
}
});
代码示例来源:origin: stackoverflow.com
TextView tv=<find>
LayoutParams lp = (LayoutParams) tv.getLayoutParams();
lp2.height = 100;
tv.setLayoutParams(lp);
tv.requestLayout();
代码示例来源:origin: ssomai/ScalableLayout
public void onClick_SetLessText(View view) {
TextView tv = (TextView) findViewById(R.id.tv_moretext);
tv.setText(tv.getText().subSequence(1, tv.getText().length()));
tv.requestLayout();
}
}
代码示例来源:origin: CNCoderX/ExpandableTextView
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int height = (int) animation.getAnimatedValue();
ViewGroup.LayoutParams lParams = mTextView.getLayoutParams();
lParams.height = height;
mTextView.requestLayout();
}
代码示例来源:origin: evrencoskun/TableViewSampleApp
public void setCellModel(CellModel p_jModel, int pColumnPosition) {
// Change textView align by column
cell_textview.setGravity(ColumnHeaderViewHolder.COLUMN_TEXT_ALIGNS[pColumnPosition] |
Gravity.CENTER_VERTICAL);
// Set text
cell_textview.setText(String.valueOf(p_jModel.getData()));
// It is necessary to remeasure itself.
cell_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
cell_textview.requestLayout();
}
代码示例来源:origin: evrencoskun/TableViewSampleApp
public void setColumnHeaderModel(ColumnHeaderModel pColumnHeaderModel, int pColumnPosition) {
// Change alignment of textView
column_header_textview.setGravity(COLUMN_TEXT_ALIGNS[pColumnPosition] | Gravity
.CENTER_VERTICAL);
// Set text data
column_header_textview.setText(pColumnHeaderModel.getData());
// It is necessary to remeasure itself.
column_header_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
column_header_textview.requestLayout();
}
代码示例来源:origin: stackoverflow.com
TextView txtVertical = (TextView)findViewById(R.id.txtVertical);
txtVertical.requestLayout();
txtVertical.getLayoutParams().height = 230;
txtVertical.getLayoutParams().width = 400;
txtVertical.setPadding(6, 6, 6, 6);
代码示例来源:origin: stackoverflow.com
ListView lv = getListView();
lv.requestLayout();
if(aa.arrayValue.size() > 0) {
lv.setVisibility(ListView.VISIBLE);
setListAdapter(new Adaptor(this, R.layout.main_list_item, aa.arrayValue));
}
else {
lv.setVisibility(ListView.INVISIBLE);
TextView tv = (TextView) findViewById(android.R.id.empty);
tv.requestLayout();
tv.setVisibility(TextView.VISIBLE);
}
代码示例来源:origin: evrencoskun/TableViewSampleApp
@Override
public void onSortingStatusChanged(SortState pSortState) {
super.onSortingStatusChanged(pSortState);
// It is necessary to remeasure itself.
column_header_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
controlSortState(pSortState);
column_header_textview.requestLayout();
column_header_sort_button.requestLayout();
column_header_container.requestLayout();
itemView.requestLayout();
}
代码示例来源:origin: stackoverflow.com
TableRow tableRow = lv.getItemAtPosition(1);
for (int i = 0; i < tableRow.getChildCount(); i++) {
View child = tableRow.getChildAt(i);
if ( child instanceof TextView ) {
TextView textView = (TextView) child;
textView.DO_SOMETHIG__WITH_TEXT_VIEV();
textView.requestLayout();
}
}
tableRow.requestLayout();
内容来源于网络,如有侵权,请联系作者删除!