我想知道是否有任何方法可以检测我的应用程序未运行时iphone音乐库是否已更改.
在MPMediaLibrary类中有一个属性lastModifiedDate来执行此操作,但我遇到的问题是即使iPhone未同步,此日期也会更改.如果在iPod中更改了正在播放列表或当前播放列表,则日期通常会更改.
有没有其他方法可以检测iPhone是否已同步?
我正在使用 heightForRowAtIndexPath: 方法返回 100 设置单元格的高度。但在 cellForRowAtIndexPath 方法中,单元格的框架高度始终为 44px。
以下是我的代码。
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
- (int) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}
[cell setBackgroundColor:[UIColor redColor]];
[cell.contentView setBackgroundColor:[UIColor redColor]];
cell.textLabel.text = [NSString stringWithFormat:@"%d", indexPath.row];
NSLog(@"%f %f", cell.frame.size.height, cell.contentView.frame.size.height);
return cell;
}
Run Code Online (Sandbox Code Playgroud)
NSLog 语句打印“44px 44px”。
我可以使用此语句获得正确的高度
CGFloat height = [tableView heightForRowAtIndexPath:indexPath];
Run Code Online (Sandbox Code Playgroud) 我使用UIWebView在html文件中设置了以下视口标记.
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
现在,当用户拍摄时,我得到了如图所示的效果.我想禁用此效果,但仍然可以放大.
通过将UIWebView的反弹设置为NO来尝试,但仍然存在此问题.

谢谢.
ios ×2
objective-c ×2
ios6 ×1
iphone ×1
pinchzoom ×1
sync ×1
uitableview ×1
uiwebview ×1
viewport ×1