• <i id='wSsvD'><tr id='wSsvD'><dt id='wSsvD'><q id='wSsvD'><span id='wSsvD'><b id='wSsvD'><form id='wSsvD'><ins id='wSsvD'></ins><ul id='wSsvD'></ul><sub id='wSsvD'></sub></form><legend id='wSsvD'></legend><bdo id='wSsvD'><pre id='wSsvD'><center id='wSsvD'></center></pre></bdo></b><th id='wSsvD'></th></span></q></dt></tr></i><div id='wSsvD'><tfoot id='wSsvD'></tfoot><dl id='wSsvD'><fieldset id='wSsvD'></fieldset></dl></div>
  • <legend id='wSsvD'><style id='wSsvD'><dir id='wSsvD'><q id='wSsvD'></q></dir></style></legend>
        <bdo id='wSsvD'></bdo><ul id='wSsvD'></ul>

        <small id='wSsvD'></small><noframes id='wSsvD'>

        <tfoot id='wSsvD'></tfoot>

      1. 在 UITextView Objective-C 内的文本末尾添加更多按钮?

        时间:2023-07-06
          <tbody id='qVOTC'></tbody>
          <i id='qVOTC'><tr id='qVOTC'><dt id='qVOTC'><q id='qVOTC'><span id='qVOTC'><b id='qVOTC'><form id='qVOTC'><ins id='qVOTC'></ins><ul id='qVOTC'></ul><sub id='qVOTC'></sub></form><legend id='qVOTC'></legend><bdo id='qVOTC'><pre id='qVOTC'><center id='qVOTC'></center></pre></bdo></b><th id='qVOTC'></th></span></q></dt></tr></i><div id='qVOTC'><tfoot id='qVOTC'></tfoot><dl id='qVOTC'><fieldset id='qVOTC'></fieldset></dl></div>

          1. <tfoot id='qVOTC'></tfoot>
            • <small id='qVOTC'></small><noframes id='qVOTC'>

              • <bdo id='qVOTC'></bdo><ul id='qVOTC'></ul>

                <legend id='qVOTC'><style id='qVOTC'><dir id='qVOTC'><q id='qVOTC'></q></dir></style></legend>
                1. 本文介绍了在 UITextView Objective-C 内的文本末尾添加更多按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试做与此链接中的类似的事情 http://www.oracle.com/webfolder/ux/mobile/pattern/img/expand-collpase-description.png

                  I am trying to do something similar to the one in this link http://www.oracle.com/webfolder/ux/mobile/pattern/img/expand-collpase-description.png

                  单击更多"按钮时扩展 UITextView 内的内容.我正在我的 viewDidLoad 中创建按钮,如下所示

                  Expanding the content inside a UITextView when clicking the button 'more'. I am creating the button in my viewDidLoad like the below

                  UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
                  [button setTitle:@"more" forState:UIControlStateNormal];
                  [self.detailPriceView addSubview:button];
                  

                  从 PFQuery 加载数据后,我正在 UITextView 内设置按钮的框架

                  I am setting the frame of the button inside the UITextView after loading the data from PFQuery

                  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];
                  }
                  }];
                  

                  如何在文本末尾的 UITextView 中添加更多按钮?我还创建了一个约束以在单击更多按钮时增加它的高度,但我无法将约束的高度增加到超过某个阈值大小.

                  How to add more button inside UITextView at the end of the text ? Also i created a constraint to increase it's height when the more button is clicked, but i'm unable to increase the constraint's height beyond some threshold size.

                  推荐答案

                  我也在做同样的事情.只需将按钮添加到textView.superView,因为textView 是scrollView.在 textView 中使用按钮的矩形作为
                  textView.textContainer.exclusionPaths = [UIBezierPath(rect: rect)]

                  I'm doing the same thing. Just add the button to textView.superView, because textView is scrollView. Use button's rect in textView as
                  textView.textContainer.exclusionPaths = [UIBezierPath(rect: rect)]

                  最后,我做到了.最重要的是 rect 必须在 textView.frame包含.

                  At last, I did it. Most important thing is rect must be included in textView.frame.

                  这篇关于在 UITextView Objective-C 内的文本末尾添加更多按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:点击后更改 UIButton 的文本或背景 下一篇:UIPageControl - 单击按钮更改页面

                  相关文章

                    <small id='prTTJ'></small><noframes id='prTTJ'>

                  1. <legend id='prTTJ'><style id='prTTJ'><dir id='prTTJ'><q id='prTTJ'></q></dir></style></legend>
                    1. <i id='prTTJ'><tr id='prTTJ'><dt id='prTTJ'><q id='prTTJ'><span id='prTTJ'><b id='prTTJ'><form id='prTTJ'><ins id='prTTJ'></ins><ul id='prTTJ'></ul><sub id='prTTJ'></sub></form><legend id='prTTJ'></legend><bdo id='prTTJ'><pre id='prTTJ'><center id='prTTJ'></center></pre></bdo></b><th id='prTTJ'></th></span></q></dt></tr></i><div id='prTTJ'><tfoot id='prTTJ'></tfoot><dl id='prTTJ'><fieldset id='prTTJ'></fieldset></dl></div>

                      <tfoot id='prTTJ'></tfoot>
                        <bdo id='prTTJ'></bdo><ul id='prTTJ'></ul>