![]() ![]() I don't set at all the paddings and I don't call. Swtch_EnableEdit is previously defined like this (Xamarin): Switch swtch_EnableEdit = view.FindViewById(Resource.Id.mySwitch) Swtch_EnableEdit.ThumbDrawable = drawable ![]() ThumbStates.addState(new int, new ColorDrawable(colorOff)) ![]() StateListDrawable thumbStates = new StateListDrawable() This is working for me (requires Android 4.1): Switch switchInput = new Switch(this) The way in which it should be correctly applied is through also this can be applied to parent styles such as EditTexts, RadioButtons, Switches, CheckBoxes and ProgressBars: You can then use simple styling to change the color of your components. As of now it is better to use SwitchCompat from the AppCompat.v7 library. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |