Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't see dynamic subview on iOS7(Working on iOS6)
    primarykey
    data
    text
    <p>I have a custom TableViewCell. In the cell, I add two cross icons (using unicode) to both sides of the cell. when the user pans the cell, it will display the cross icon on the side.</p> <pre><code>- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // add a cross _crossLabel = [self createCueLabel]; _crossLabel.text = @"\u274C"; _crossLabel.textAlignment = NSTextAlignmentLeft; // none of the following code works [self insertSubview:_crossLabel aboveSubview:self]; [self insertSubview:_crossLabel belowSubview:self]; [self addSubview:_crossLabel]; _crossLabel2 = [self createCueLabel]; _crossLabel2.text = @"\u274C"; _crossLabel2.textAlignment = NSTextAlignmentLeft; [self addSubview:_crossLabel2]; // add a pan recognizer UIGestureRecognizer* recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; recognizer.delegate = self; [self addGestureRecognizer:recognizer]; } return self; } </code></pre> <p>I used the code above to achieve that. And the _crossLabel did add to the Custom TableView Cell. </p> <p>I used <a href="http://revealapp.com" rel="nofollow noreferrer">Reveal App</a> to check the layout of my iOS app <img src="https://i.stack.imgur.com/kipBz.png" alt="enter image description here"> I can see _crossLabel has been added to my Cell. But I can't see the cross icon in my iOS 7 simulator. I have tried different methods to add the subView, but none of them works.</p> <p><img src="https://i.stack.imgur.com/NySoq.png" alt="enter image description here"></p> <p>But it works perfectly on iOS6 and the layout is exactly same as iOS 7 when I check in Reveal App.</p> <p>Thanks for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload