【问题标题】:iOS Image View turn off selection highlightingiOS Image View 关闭选择突出显示
【发布时间】:2013-06-12 02:27:45
【问题描述】:

有点奇怪的问题,所以我附上了一个屏幕录像来帮助......

视频:https://www.dropbox.com/s/3aaefixsk8eejln/Error.mov(查看过去的水印!)

我的问题是,在我的应用程序中,当用户处于“预览”视图并正在查看他们的图像时,每次选择图像时,图像都会收到触摸覆盖,这可能会让用户感到困惑,因为没有任何反应触摸时。

如果可能的话,我想禁用它..

下面是如何显示图像的示例代码..

 - (void)setReviewImages
{
    continueButtonDisabled = YES;
    downloadedImageCount = 0;

    NSArray *reviewViews = scrollView.subviews;
    for (IMReviewView *reviewView in reviewViews) {
        [reviewView removeFromSuperview];
    }

    NSUInteger photoCount = [[IMLocalUser localUser] cachedPhotoCount];
    if ( nPageNum == 0 ){
        for (NSUInteger i = 0; i < photoCount; i++) {

            CGRect frame;
            frame.origin.x  = scrollView.frame.size.width * i;
            frame.origin.y  = 65;
            frame.size      = CGSizeMake(scrollView.frame.size.width, 327.0f);

            IMReviewView *subview = [[IMReviewView alloc] initWithFrame:frame];
            subview.delegate = self;
            subview.photo = [[IMLocalUser localUser] cachedPhotoAtIndex:i];
            [scrollView addSubview:subview];

            scrollView.showsHorizontalScrollIndicator = NO;
            scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * i, scrollView.frame.size.height);

            UILabel *headingLabel = [[UILabel alloc] initWithFrame:CGRectMake(12, 20, 300, 30)];
            [self.view addSubview:headingLabel];


            headingLabel.text = @"Time To Preview!";
            headingLabel.textColor = [UIColor blackColor];
            headingLabel.textAlignment = UITextAlignmentCenter;

            headingLabel.textAlignment = NSTextAlignmentCenter;
            headingLabel.tag = 10;
            headingLabel.backgroundColor = [UIColor clearColor];
            headingLabel.font = [UIFont boldSystemFontOfSize:26.0f];
            headingLabel.hidden = NO;
            headingLabel.highlighted = YES;
            headingLabel.highlightedTextColor = [UIColor blackColor];
            headingLabel.lineBreakMode = YES;
            headingLabel.numberOfLines = 0;
        }

【问题讨论】:

  • 你可能想成为这个东西的集合视图......

标签: ios image uiimageview overlay highlight


【解决方案1】:

在我看来 IMReviewView 有一个 UIButton 子视图。如果是这样,请尝试将其adjustsImageWhenHighlighted 属性设置为NO

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-15
    • 1970-01-01
    • 2012-12-15
    • 2015-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多