本文整理了Java中android.widget.EditText.getLayoutParams()方法的一些代码示例,展示了EditText.getLayoutParams()的具体用法。这些代码
本文整理了Java中android.widget.EditText.getLayoutParams()
方法的一些代码示例,展示了EditText.getLayoutParams()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EditText.getLayoutParams()
方法的具体详情如下:
包路径:android.widget.EditText
类名称:EditText
方法名:getLayoutParams
EditText.getLayoutParams介绍
暂无
代码示例
代码示例来源:origin: OpenCraft/AnimatedExpandableEditText
public void onAnimationUpdate(ValueAnimator animation) {
Integer value = (Integer) animation.getAnimatedValue();
editText.getLayoutParams().height = value.intValue();
editText.requestLayout();
}
});
代码示例来源:origin: consp1racy/android-support-preference
/**
* Adds the EditText widget of this preference to the dialog's view.
*
* @param dialogView The dialog view.
*/
private void onAddEditTextToDialogView(@NonNull View dialogView, @NonNull EditText editText) {
ViewGroup cOntainer= dialogView.findViewById(R.id.edittext_container);
if (container != null) {
final ViewGroup.LayoutParams lp = editText.getLayoutParams();
if (lp == null) {
container.addView(editText, ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
} else {
container.addView(editText, lp);
}
} else {
throw new IllegalStateException("EditTextPreference dialog layout needs to contain" +
" a layout with id @id/edittext_container.");
}
}
代码示例来源:origin: stackoverflow.com
cOntainerLayout= (LinearLayout)findViewById(R.id.LinearLayout1);
//now create loop
for(int i=0; i<=arraysize; i++){
EditText editText+String.valueof(i) = new EditText(getBaseContext());
containerLayout.addView(editText+String.valueof(i));
editText.setGravity(Gravity.Left);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) editText.getLayoutParams();
layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT;
layoutParams.height = LinearLayout.LayoutParams.MATCH_PARENT;
// layoutParams.setMargins(23, 34, 0, 0);
// RelativeLayout.LayoutParams()
editText.setLayoutParams(layoutParams);
//if you want to identify the created editTexts, set a tag, like below
editText+String.valueof(i).setTag("EditText" + i);
}
代码示例来源:origin: derry/delion
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
if (progressBarView.getMeasuredHeight() == input.getMeasuredHeight()
&& input.getBackground() != null) {
// Force the text field to align better with the icon by accounting for the
// padding introduced by the background drawable.
input.getLayoutParams().height =
progressBarView.getMeasuredHeight() + input.getPaddingBottom();
v.requestLayout();
v.removeOnLayoutChangeListener(this);
}
}
});
代码示例来源:origin: stackoverflow.com
public class ScrollStuff extends Activity {
LinearLayout containerLayout;
static int totalEditTexts = 0;
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.scroll);
cOntainerLayout= (LinearLayout)findViewById(R.id.mlayout);
}
public void onBackPressed() {
totalEditTexts++;
if (totalEditTexts > 100)
return;
EditText editText = new EditText(this);
containerLayout.addView(editText);
editText.setGravity(Gravity.RIGHT);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) editText.getLayoutParams();
layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT;
editText.setLayoutParams(layoutParams);
//if you want to identify the created editTexts, set a tag, like below
editText.setTag("EditText" + totalEditTexts);
}
}
代码示例来源:origin: stackoverflow.com
tempText1.setLayoutParams(editText1.getLayoutParams());
tempText2.setLayoutParams(editText2.getLayoutParams());
代码示例来源:origin: TMLAndroid/FillBlankDemo
public void setEtXY( RectF rf) {
//设置et w,h的值
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) mEt.getLayoutParams();
lp.width = (int)(rf.right - rf.left);
lp.height = (int)(rf.bottom - rf.top);
//设置et 相对于tv x,y的相对位置
lp.leftMargin = (int) (mTv.getLeft()+rf.left);
lp.topMargin = (int) (mTv.getTop()+rf.top);
mEt.setLayoutParams(lp);
//获取焦点,弹出软键盘
mEt.setFocusable(true);
mEt.requestFocus();
showImm(true,mEt);
}
代码示例来源:origin: stackoverflow.com
mFocusDistraction.setBackgroundResource(android.R.color.transparent);
this.addView(mFocusDistraction);
mFocusDistraction.getLayoutParams().width = 1;
mFocusDistraction.getLayoutParams().height = 1;
代码示例来源:origin: stackoverflow.com
TableRowAbonados nuevaFila = new TableRowAbonados(this);
TableLayout.LayoutParams tableRowParams = new TableLayout.LayoutParams(
TableLayout.LayoutParams.MATCH_PARENT,
TableLayout.LayoutParams.WRAP_CONTENT);
int leftMargin = 0;
int topMargin = 0;
int rightMargin = 0;
int bottomMargin = getStandardPixels(5);
tableRowParams.setMargins(leftMargin, topMargin, rightMargin,
bottomMargin);
nuevaFila.setLayoutParams(tableRowParams);
Button botOnAbono= new Button(this);
Button botOnFecha= new Button(this);
Button botOnMetodo= new Button(this);
EditText celdaDosis = new EditText(this);
celdaDosis.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
nuevaFila.addView(botonAbono);
nuevaFila.addView(botonFecha);
nuevaFila.addView(botonMetodo);
nuevaFila.addView(celdaDosis);
botonAbono.getLayoutParams().height=TableRow.LayoutParams.MATCH_PARENT;
botonFecha.getLayoutParams().height=TableRow.LayoutParams.MATCH_PARENT;
botonMetodo.getLayoutParams().height=TableRow.LayoutParams.MATCH_PARENT;
celdaDosis.getLayoutParams().height=TableRow.LayoutParams.MATCH_PARENT;
layoutTablaAbonados.addView(nuevaFila);
代码示例来源:origin: stackoverflow.com
LayoutParams params = editText.getLayoutParams();
ViewGroup vg = (ViewGroup)editText.getParent();
String curVal = editText.getText().toString();
代码示例来源:origin: florent37/android-slidr
private void editBubbleEditPosition() {
if (isEditing) {
editText.setX(Math.min(bubble.getX(), getWidth() - editText.getWidth()));
editText.setY(bubble.getY());
final ViewGroup.LayoutParams params = editText.getLayoutParams();
params.width = (int) bubble.width;
params.height = (int) bubble.getHeight();
editText.setLayoutParams(params);
editText.animate().alpha(1f);
}
}
代码示例来源:origin: ywwynm/EverythingDone
holder.et.getLayoutParams();
params.width = LinearLayout.LayoutParams.MATCH_PARENT;
params.topMargin = (int) (density * 3);
代码示例来源:origin: ywwynm/EverythingDone
} else if (!noImage) {
LinearLayout.LayoutParams llp = (LinearLayout.LayoutParams)
etContent.getLayoutParams();
llp.topMargin = (int) (density * 8);
etContent.requestLayout();
代码示例来源:origin: chengzichen/KrGallery
searchField.setTextIsSelectable(false);
searchContainer.addView(searchField);
LayoutParams layoutParams2 = (LayoutParams) searchField.getLayoutParams();
layoutParams2.width = LayoutHelper.MATCH_PARENT;
layoutParams2.gravity = Gravity.CENTER_VERTICAL;
代码示例来源:origin: ywwynm/EverythingDone
} else if (did == UPDATE_CONTENT_MARGIN) {
LinearLayout.LayoutParams llp = (LinearLayout.LayoutParams)
etContent.getLayoutParams();
llp.topMargin = (int) (density * 20);
etContent.requestLayout();
代码示例来源:origin: WowzaMediaSystems/gocoder-sdk-samples-android
mAutoCompleteEditText.setLayoutParams(editText.getLayoutParams());
mAutoCompleteEditText.setImeOptions(editText.getImeOptions());
mAutoCompleteEditText.setInputType(editText.getInputType());