本文整理了Java中android.widget.Switch.setTextSize()
方法的一些代码示例,展示了Switch.setTextSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Switch.setTextSize()
方法的具体详情如下:
包路径:android.widget.Switch
类名称:Switch
方法名:setTextSize
暂无
代码示例来源:origin: marzika/Snapprefs
private void applyLogTypeSwitches(LinearLayout layout) {
LogType[] logTypes = Logger.LogType.values();
final float scale = getContext().getResources().getDisplayMetrics().density;
HashSet<String> activeTypes = Logger.getActiveLogTypes();
for (LogType logType : logTypes) {
Switch logSwitch = new Switch(layout.getContext());
int pad = (int) (10f * scale);
logSwitch.setPadding(pad, pad / 2, pad, pad / 2);
logSwitch.setText(logType.name());
logSwitch.setChecked(activeTypes.contains(logType.name()));
logSwitch.setTextSize(7f * scale);
logSwitch.setTextColor(Color.GRAY);
logSwitch.setTag(logType.name());
logSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean state) {
String tag = (String) compoundButton.getTag();
Logger.setLogTypeState(tag, state);
}
});
layout.addView(logSwitch);
}
}
}
代码示例来源:origin: linglongxin24/ARDevelopDemo
newSwitchView.setTextSize(mEntriesTextSize);
newSwitchView.setTag(command);
newSwitchView.setVisibility(View.VISIBLE);
代码示例来源:origin: Odoo-mobile/framework
mSwitch.setText(mLabel);
if (textSize > -1) {
mSwitch.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
内容来源于网络,如有侵权,请联系作者删除!