小编Vij*_*eta的帖子

将图像添加到iPhone模拟器

我想用UIImagePickerControllerUIImagePickerControllerSourceTypePhotoLibrary,但它说,"没有照片".模拟器从哪里获取图像?我应该在哪里复制图像,以便它们显示在模拟器中?

iphone photo uiimagepickercontroller ios ios-simulator

268
推荐指数
18
解决办法
15万
查看次数

设置自定义UITableViewCells高度

我正在使用自定义UITableViewCell,它有一些标签,按钮和图像视图可供显示.单元格中有一个标签,其文本是NSString对象,字符串的长度可以是可变的.由于这一点,我无法设置恒定的高度到细胞中UITableViewheightForCellAtIndex方法.细胞的高度取决于这可以使用被确定标签的高度NSStringsizeWithFont方法.我尝试过使用它,但看起来我在某个地方出错了.怎么修好?

这是用于初始化单元格的代码.

if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier])
{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    UIImage *image = [UIImage imageNamed:@"dot.png"];
    imageView = [[UIImageView alloc] initWithImage:image];
    imageView.frame = CGRectMake(45.0,10.0,10,10);

    headingTxt = [[UILabel alloc] initWithFrame:   CGRectMake(60.0,0.0,150.0,post_hdg_ht)];
    [headingTxt setContentMode: UIViewContentModeCenter];
    headingTxt.text = postData.user_f_name;
    headingTxt.font = [UIFont boldSystemFontOfSize:13];
    headingTxt.textAlignment = UITextAlignmentLeft;
    headingTxt.textColor = [UIColor blackColor];

    dateTxt = [[UILabel alloc] initWithFrame:CGRectMake(55.0,23.0,150.0,post_date_ht)];
    dateTxt.text = postData.created_dtm;
    dateTxt.font = [UIFont italicSystemFontOfSize:11];
    dateTxt.textAlignment = UITextAlignmentLeft;
    dateTxt.textColor = [UIColor grayColor];

    NSString * text1 …
Run Code Online (Sandbox Code Playgroud)

objective-c row-height uitableview ios

221
推荐指数
8
解决办法
27万
查看次数

如何将参数传递给此函数?

我有以下代码:

[replyAllBtn addTarget:self.target action:@selector(ReplyAll:) forControlEvents:UIControlEventTouchUpInside];

- (void)replyAll:(NSInteger)tid {
// some code
}
Run Code Online (Sandbox Code Playgroud)

如何向ReplyAll函数发送参数?

iphone objective-c

10
推荐指数
1
解决办法
2万
查看次数