本文整理了Java中android.widget.ImageView.setDuplicateParentStateEnabled()
方法的一些代码示例,展示了ImageView.setDuplicateParentStateEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setDuplicateParentStateEnabled()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setDuplicateParentStateEnabled
暂无
代码示例来源:origin: ssomai/ScalableLayout
/**
* adds new ImageView with (Drawable, Left, Top, Width, Height, DuplicateState) parameters
* sets Image of ImageView with Drawable parameter
* @param drawable
* @param pScale_Left
* @param pScale_Top
* @param pScale_Width
* @param pScale_Height
* @param pDuplicateState
* @return
*/
public ImageView addNewImageView(Drawable drawable, float pScale_Left, float pScale_Top, float pScale_Width, float pScale_Height, boolean pDuplicateState) {
ImageView lNewImageView = new ImageView(getContext());
lNewImageView.setImageDrawable(drawable);
lNewImageView.setScaleType(ScaleType.FIT_XY);
lNewImageView.setDuplicateParentStateEnabled(pDuplicateState);
addView(lNewImageView, pScale_Left, pScale_Top, pScale_Width, pScale_Height);
return lNewImageView;
}
代码示例来源:origin: ViHtarb/Tooltip
public TooltipActionView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setClickable(true);
setLongClickable(true);
int itemWidth = getResources().getDimensionPixelSize(R.dimen.action_button_width);
int itemPadding = getResources().getDimensionPixelSize(R.dimen.action_button_padding);
LayoutParams layoutParams = new LayoutParams(itemWidth - itemPadding, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER);
mTextView = new TextView(context);
mImageView = new ImageView(context);
mTextView.setDuplicateParentStateEnabled(true);
mImageView.setDuplicateParentStateEnabled(true);
addView(mTextView, layoutParams);
addView(mImageView, layoutParams);
}
内容来源于网络,如有侵权,请联系作者删除!