本文整理了Java中android.widget.Switch.setTextOn()
方法的一些代码示例,展示了Switch.setTextOn()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Switch.setTextOn()
方法的具体详情如下:
包路径:android.widget.Switch
类名称:Switch
方法名:setTextOn
暂无
代码示例来源:origin: lygttpod/SuperTextView
mSwitch.setTextOn(mTextOn);
代码示例来源:origin: willowtreeapps/Hyperion-Android
@Override
protected void mutate(CharSequence value) {
view.setTextOn(value);
}
});
代码示例来源:origin: stackoverflow.com
Switch sw = new Switch(MainActivity.this);
sw.setTextOn("start");
sw.setTextOff("close");
LinearLayout linearLayout = new LinearLayout(MainActivity.this);
linearLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
linearLayout.setGravity(Gravity.CENTER_HORIZONTAL);
linearLayout.addView(sw);
AlertDialog.Builder myDialog = new AlertDialog.Builder(MainActivity.this);
myDialog.setTitle("title");
myDialog.setMessage("message");
myDialog.setView(linearLayout);
myDialog.show();
代码示例来源:origin: jelic98/dynamico
switchButton.setTextOn(attributes.getString("textOn"));
switchButton.setTextOn(attributes.getString("textOff"));
代码示例来源:origin: thuryn/your-local-weather
SimpleDateFormat sdf = new SimpleDateFormat("EEE", locale);
final String textOn = sdf.format(dateForSetting);
dayNameSwitch.setTextOn(textOn);
sdf = new SimpleDateFormat("EEEE", locale);
final String textOff = sdf.format(dateForSetting);
代码示例来源:origin: consp1racy/android-support-preference
private void syncSwitchView(@NonNull final View view) {
if (view instanceof Checkable) {
final Checkable checkable = (Checkable) view;
final boolean isChecked = checkable.isChecked();
if (isChecked == mChecked) return;
if (view instanceof SwitchCompat) {
SwitchCompat switchView = (SwitchCompat) view;
switchView.setTextOn(this.mSwitchOn);
switchView.setTextOff(this.mSwitchOff);
switchView.setOnCheckedChangeListener(null);
} else if (view instanceof Switch) {
Switch switchView = (Switch) view;
switchView.setTextOn(this.mSwitchOn);
switchView.setTextOff(this.mSwitchOff);
switchView.setOnCheckedChangeListener(null);
}
checkable.toggle();
if (view instanceof SwitchCompat) {
SwitchCompat switchView = (SwitchCompat) view;
switchView.setOnCheckedChangeListener(mListener);
} else if (view instanceof Switch) {
Switch switchView = (Switch) view;
switchView.setOnCheckedChangeListener(mListener);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!