-1
我想知道如何以编程方式在我的精灵套件场景中定位UISwitch。是否有像SKSpritenodes这样的.position
属性或类似的东西?在精灵套件中放置UISwitch
代码:
UISwitch *vibrateSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(20, 20, 20, 20)];
vibrateSwitch.on = YES;
[vibrateSwitch addTarget:self action:@selector(vibrateSwitch:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:vibrateSwitch];