-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];