TTPhotoViewController: Disable Gallery Auto View

In my project, I use the Facebook "three20" API: https://github.com/facebook/three20/

Now I need to configure TTPhotoViewController. There is an "automatic zoom" in the gallery. Full width and height are always used: enter image description here

The disadvantage is that you cannot see the full photo, and important information can be cropped / cropped.

How to disable automatic scaling?

Thank!


EDIT 03-Mar-2011:

The Roman answer seems good, but unfortunately this does not help me. Yes, content mode UIViewContentModeScaleAspectFillis a problem:

Scaling content to fill the size of the view. Some of the content may be cropped to fill the border views.

, . , 20 . , ! , "" (03/03/2011)...

!


EDIT 07-Mar-2011:

- ! , UIViewContentModeScaleAspectFit.

: Photo -Object! 320x480 :

NSMutableArray *photos = [NSMutableArray new];

for (Information *info in allImages) {
    NSString *binaryId = info.binary;

    NSString *fileName = [NSString stringWithFormat:@"documents://img/%@.jpg", binaryId];

    Photo *photo = [[[Photo alloc] initWithCaption:info.name 
                                              urlLarge:fileName 
                                              urlSmall:fileName 
                                              urlThumb:fileName 
                                              size:CGSizeMake(320, 480)] autorelease];

    [photos addObject:photo];

}

self.photoSource = [[PhotoSet alloc] initWithTitle:@"Photos" photos:photos];
+3
3

TTPhotoView - 135 ( setImage)

self.contentMode = UIViewContentModeScaleAspectFill;

self.contentMode = UIViewContentModeScaleAspectFit;

, .

+6

, , Three20 . 104 " " ( ) WWDC 2010 iTunes. , , , Three20.

+3

Make this change to the TTScrollView class

In method

- (CGRect)frameOfPageAtIndex:(NSInteger)pageIndex 

In this method, change the following line

if (size.width > size.height) { 

to

if (size.width / size.height > self.width / self.height) { 

It worked for me.

0
source

Source: https://habr.com/ru/post/1787498/


All Articles