在UITextView中输入时,文字不可见; 完成输入后,文字不可见。
如何让它可见?
代码如下。我没有故意放置与UITextView相关的代码,因为只设置了字体和对齐属性。
// Setup the background image view.
[self.backgroundImageView setBackgroundColor:[UIColor blackColor]];
[self.view sendSubviewToBack:self.backgroundImageView];
// Set the image view.
CGRect r = CGRectMake(0, 0, self.TextView.bounds.size.width, 455);
ImageView = [[UIImageView alloc] initWithFrame:r];
// Set up the scroll view for the image zooming in/out and scrolling.
imgScrollView = [[UIScrollView alloc] initWithFrame:ImageView.bounds];
[imgScrollView setScrollEnabled:YES];
[imgScrollView setClipsToBounds:YES];
[imgScrollView addSubview:ImageView];
[imgScrollView setBackgroundColor:[UIColor clearColor]];
[imgScrollView setContentSize:ImageView.frame.size];
imgScrollView.maximumZoomScale = 5.0;
imgScrollView.delegate = self;
UITapGestureRecognizer *doubleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scrollViewDoubleTapped:)];
doubleTapRecognizer.numberOfTapsRequired = 2;
doubleTapRecognizer.numberOfTouchesRequired = 1;
[imgScrollView addGestureRecognizer:doubleTapRecognizer];
[imgScrollView sendSubviewToBack:self.TextView];
[self.view addSubview:imgScrollView];
更新
[imgScrollView addSubview:self.TextView];
上面的代码解决了这个问题。