0
我有一个应用程序,我已经设置了一个通知。当通知提高时,则根据设备的音量级别发出声音。所以我想在视图中添加一个进度条或滑块来控制设备的音量。例如,你有一个视图,其中你有滑块/进度条。当你滑动它们时,音量增加或减少。 如何通过这些工具控制设备的音量?如何通过我们的应用程序通过进度或滑动条来控制设备的音量?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString * CellIdentifier = @“Cell”;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
if(indexPath.row==0)
{
cell.textLabel.text = @"Vibration";
UISwitch *switch_vib=[[UISwitch alloc] initWithFrame:CGRectMake(210, 9, 94, 27)];
switch_vib.on=YES;
[cell addSubview:switch_vib];
}
else //if(indexPath.row==1)
cell.textLabel.text = @"Set volumes";
return cell;
}
在此先感谢...