Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this proper way to add UIImageView, last item not full image, breaking on rotation #183

Open
Tagalong opened this issue Oct 16, 2015 · 1 comment

Comments

@Tagalong
Copy link

I followed the paging example. This is my code in - (UIView *)swipeView:(SwipeView *)swipeView viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view. I'm having issues with aspectFit not working, lag on swiping, and image not filling entire view or two partial images filling the view. Also, when I rotate I sometimes get 2 partial images filling the view.

`if
(view == nil)

{
    view = [[UIView alloc] initWithFrame:self.swipeView.bounds];

    view.translatesAutoresizingMaskIntoConstraints = NO;

    view.backgroundColor = [UIColor clearColor];

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:view.bounds];
    NSDictionary *imageViewsDictionary = @{@"view" : view, @"imageView" : imageView};
    imageView.translatesAutoresizingMaskIntoConstraints = NO;
    imageView.tag = 1;
    [view addSubview:imageView];
    imageView.contentMode = UIViewContentModeScaleAspectFit;
    imageView.bounds = view.bounds;
    [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[imageView]|" options:0 metrics:nil views:imageViewsDictionary]];
    [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[imageView]|" options:0 metrics:nil views:imageViewsDictionary]];
}`

The last "page" in the swipe view is always a half page
img_0718

@alexszilagyi
Copy link

@Tagalong : Have you solved this issue? Did you've found any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants