ios - ScaleToFit does not work -


i have problems scaletofit method. have uipageviewcontroller uiimagesview , want show different pictures in it, not work should.

with these 2 lines initialize picture.

self.screenpicture.image = [uiimage imagenamed:@"1.png"]; self.screenpicture.contentmode = uiviewcontentmodescaleaspectfit; 

it's build in case structure, decides picture user can see.

switch(self.index)     {         case zero: {             self.screennumber.text = [nsstring stringwithformat:@"1.", nil];             self.screenpicture.image = [uiimage imagenamed:@"1.png"];             self.screenpicture.contentmode = uiviewcontentmodescaleaspectfit;             nslog(@"%d",self.index);             break;         }         case one: {             self.screennumber.text = [nsstring stringwithformat:@"2.", nil];             self.screenpicture.image = [uiimage imagenamed:@"2.png"];             self.screenpicture.contentmode = uiviewcontentmodescaleaspectfit;             nslog(@"%d",self.index);             break;         }         case two: {             self.screennumber.text = [nsstring stringwithformat:@"3.", nil];             self.screenpicture.image = [uiimage imagenamed:@"3.png"];             self.screenpicture.contentmode = uiviewcontentmodescaleaspectfit;             nslog(@"%d",self.index);             break;         }         case three: {             self.screennumber.text = [nsstring stringwithformat:@"4.", nil];             self.screenpicture.image = [uiimage imagenamed:@"4.png"];             self.screenpicture.contentmode = uiviewcontentmodescaleaspectfit;             nslog(@"%d",self.index);             break;         }         default: {             self.screennumber.text = [nsstring stringwithformat:@"5.", nil];             self.screenpicture.image = [uiimage imagenamed:@"5.png"];             self.screenpicture.contentmode = uiviewcontentmodescaleaspectfit;             nslog(@"%d",self.index);             break;         }     } 

in app picture in original size, big. why scaleaspectfit-method not working?

can me?

thanks:)

according ios developer library:

the content mode specifies how cached bitmap of view’s layer adjusted when view’s bounds change.

...and not other way around. seem want resize view based on content, contentmode opposite.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -