小编Dha*_*wal的帖子

如何在应用未运行时检测iphone是否已同步

我想知道是否有任何方法可以检测我的应用程序未运行时iphone音乐库是否已更改.

在MPMediaLibrary类中有一个属性lastModifiedDate来执行此操作,但我遇到的问题是即使iPhone未同步,此日期也会更改.如果在iPod中更改了正在播放列表或当前播放列表,则日期通常会更改.

有没有其他方法可以检测iPhone是否已同步?

iphone sync objective-c mpmusicplayercontroller

5
推荐指数
1
解决办法
595
查看次数

UITableViewCell 框架高度始终为 44px

我正在使用 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)

objective-c uitableview ios heightforrowatindexpath ios6

5
推荐指数
1
解决办法
3279
查看次数

iOS UIWebView:禁用此(缩小)状态但已启用放大

我使用UIWebView在html文件中设置了以下视口标记.

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">

现在,当用户拍摄时,我得到了如图所示的效果.我想禁用此效果,但仍然可以放大.

通过将UIWebView的反弹设置为NO来尝试,但仍然存在此问题.

谢谢.

mobile-safari viewport uiwebview ios pinchzoom

3
推荐指数
1
解决办法
2246
查看次数