本文整理了Java中android.widget.ImageView.setImportantForAccessibility()
方法的一些代码示例,展示了ImageView.setImportantForAccessibility()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setImportantForAccessibility()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setImportantForAccessibility
暂无
代码示例来源:origin: derry/delion
private View createIcon(GridLayout parent, int rowIndex) {
// The icon has a pre-defined width.
ImageView icon = new ImageView(parent.getContext());
icon.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
icon.setBackgroundResource(R.drawable.payments_ui_logo_bg);
icon.setImageResource(mOption.getDrawableIconId());
icon.setMaxWidth(mIconMaxWidth);
// The icon floats to the right of everything.
GridLayout.LayoutParams iconParams = new GridLayout.LayoutParams(
GridLayout.spec(rowIndex, 1, GridLayout.CENTER), GridLayout.spec(2, 1));
iconParams.topMargin = mVerticalMargin;
ApiCompatibilityUtils.setMarginStart(iconParams, mLargeSpacing);
parent.addView(icon, iconParams);
icon.setOnClickListener(OptionSection.this);
return icon;
}
}
代码示例来源:origin: AlexMofer/ProjectX
mIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
if (Build.VERSION.SDK_INT >= 16)
mIcon.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
addView(mIcon, new LayoutParams(widthIcon, size));
内容来源于网络,如有侵权,请联系作者删除!