iOS Question Change button background

D

Deleted member 103

Guest
Hi,

how can I change the background button by code?
1) Background Image
2) Pressed Background Image
 
Do you think so?

Code:
SetBackgroundImage(btn, bmp1, 0)
SetBackgroundImage(btn, bmp2, 1)
SetBackgroundImage(btn, bmp3, 2)

'state: 0 - normal, 1 - highlighted, 2 - disabled
Sub SetBackgroundImage(b As Button, bmp As Bitmap, state As Int)
Dim no As NativeObject = b
no.RunMethod("setBackgroundImage:forState:", Array(bmp, state))
End Sub
 
Upvote 0
Can I do this for a switch-View?
But the "switch-View" I have 4 states: Checked.enabled, Checked.disabled, unChecked.enabled, unChecked.disabled,
 
Upvote 0
No, you cannot change the UISwitch images.
So the images are part of the library who allows to use this view?
Maybe we can ask to extend the library to get them changeable in Wish-list-forum?
Or maybe some kind of xml we can use to set "other images" for this view?
 
Upvote 0
Back
Top