uiswitch

Swift, Xcode - Increasing the size of a UISwitch

左心房为你撑大大i 提交于 2019-12-10 01:45:46
问题 I am making my app 'universal' (used on iPhone and iPad) and I have found ways of increasing the size of everything except for UISwitches. Is there a way of doing so? Any help is greatly appreciated. 回答1: According to this answer by the user mxg, just use the following code: mySwitch.transform = CGAffineTransformMakeScale(0.75, 0.75) Of course, you have to change mySwitch to whatever the name of your variable/IBOutlet is. 回答2: Swift 3 / 4: switch.transform = CGAffineTransform(scaleX: 0.75, y:

UISwitch and UIButton in UITableViewCell, how to ident them

冷暖自知 提交于 2019-12-09 23:45:33
问题 I've got a little problem in my UITableViewCell. Each Custom Cell have an UISwitch and an UIButton. And when the user change the value of the UISwitch i would like to set the button.hidden property to YES. I can find which UISwitch was clicked with this method: - (IBAction)closeHour:(id)sender { UISwitch *senderSwitch = (UISwitch *)sender; UITableViewCell *switchCell = (UITableViewCell *)[senderSwitch superview]; NSUInteger buttonRow = [[resas indexPathForCell:switchCell] row]; NSLog("%d",

android custom Switch widget for SwitchPreferenc

徘徊边缘 提交于 2019-12-09 19:01:07
问题 I search around stackoverflow and find next related topics: How can i style an Android Switch? Custom switch widget in Android 4 Set switchStyle - get error resource not found - why? I also find bugreport on google group: Issue 36636: Unable to override style switchStyle And at last find new probles with Switch widget: I tried to make my own Preference.SwitchPreference and define layout with Switch widget android:id="@+android:id/switchWidget" android:layout_width="wrap_content" android

UISwitch in static UITableViewCell generates error

我是研究僧i 提交于 2019-12-08 19:46:17
问题 I would like to create a UIViewController with various options, each can be enabled/disabled with a UISwitch. I'm using Xcode 5 and iOS 7 deployment target. The UITableView contains static cells. The interface is created in a storyboard. When I'm adding a UISwitch to a cell (to it's contentView ) I get this error: Exception while running ibtool: *** setObjectForKey: object cannot be nil (key: objectID) Isn't it possible to add a UISwitch to a static UITableViewCell? When removing the UISwitch

Switch vs toggle

空扰寡人 提交于 2019-12-08 16:03:16
问题 I'm trying to decide whether to use a switch or toggle for setting an alarm I'm my android application. On fairly new to android and don't know or quite understand all the ins and outs of the frame work. What would be the disadvantages of choosing to trigger the alarm with a switch over a toggle, or vice versa? Is there a slide toggle available in android framework? 回答1: The first thing you need to keep in mind is since which API do you want to compile your app? Toggle Buttons are available

UISwitch added to UITableViewCell multiple times when scrolling UITableView - Swift

时光怂恿深爱的人放手 提交于 2019-12-08 08:17:08
问题 I'm making a event-menu with UITableView in swift, the majority of it is done programatically, and for some of the options in the event-menu I would like to receive a boolean value (or yes/no) from the user - so a switch would work perfect. I am adding the switch via cell.accessoryView based on the cell label text and section - as I only want the switch on 2 specific rows. The problem is that the switch gets added, then when scrolling down, and back up to the original switch, there is now a

Triple UISwitch

吃可爱长大的小学妹 提交于 2019-12-07 08:34:26
问题 I want to create a custom UISwtich with three positions. Is it possible? 回答1: You should be using UISegmentedControl if you want a standard UI-Element or configure a UISlider with a range of 2: slider.minimumValue = 0; slider.maximumValue = 2; slider.continuous = NO; And then set the minimumValueImage , maximumTrackImage and thumbImage to use appropriate images. 回答2: Not using the built-in UISwitch. You'll need to roll your own. 回答3: Why not use a UISegmentedControl? 回答4: Using UISlider is a

UISwitch with custom image

只谈情不闲聊 提交于 2019-12-07 04:23:18
问题 I need to customize UISwitch by changing background color as well as knob(holder) image as shown in below image.Is it possible to customize UISwitch without app getting rejected. Thanks in advance 回答1: There's an onTintColor property you can set on UISwitch. If you need to change the handle image as well, have a look at DCRoundSwitch. 来源: https://stackoverflow.com/questions/12400239/uiswitch-with-custom-image

Showing and hiding UITableViewCell with UISwitch too fast crashes

白昼怎懂夜的黑 提交于 2019-12-07 02:07:35
问题 I've got a UITableView that presents some settings to the user. Some cells are hidden unless a UISwitch is in the 'On' position. I've got the following code: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return switchPush.on ? 6 : 1; } // Hooked to the 'Value Changed' action of the switchPush - (IBAction)togglePush:(id)sender { NSMutableArray *indexPaths = [NSMutableArray arrayWithCapacity:0]; for(int i = 1; i <= 5; i++) { [indexPaths addObject:

UISwitch: Swift 3: Programmatically

ⅰ亾dé卋堺 提交于 2019-12-06 17:18:38
问题 How can I programmatically add a uiswitch and call an action when on and one when off? Ive been searching for hours now. Can I please have some help? I know how to add the switch but it stays on the screen no matter what scene I'm on. So far, I've been able to add the button and make it switch from on to off, but for some reason the switch just says on the screen in every scene. I was lost after that so I followed this; from How to programmatically put a UISwitch in a SpriteKit/Skcene Yes it