I create a Switch button this way:
Switch sw = new Switch(activity);
final RelativeLayout.LayoutParams ll = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
ll.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
sw.setLayoutParams(ll);
sw.setTextOn("OK");
sw.setTextOff("NOK");
layout.addView(sw);
The switch appears, but with no text. Furthermore, I want the style to be like as this URL: https://developer.xamarin.com/guides/android/user_interface/form_elements/togglebutton/
How can I achieve all of this? Thanks
EDIT:
I have get this switch button, which is ugly: