¡@

Home 

2014/10/15 ¤U¤È 10:15:02

iphone Programming Glossary: topinset

Center content of UIScrollView when smaller

http://stackoverflow.com/questions/1316451/center-content-of-uiscrollview-when-smaller

heightRatio widthRatio imageScrollView setMinimumZoomScale initialZoom imageScrollView setZoomScale 1 float topInset maxSize.height imageSize.height 2.0 float sideInset maxSize.width imageSize.width 2.0 if topInset 0.0 topInset 0.0 if sideInset.. setZoomScale 1 float topInset maxSize.height imageSize.height 2.0 float sideInset maxSize.width imageSize.width 2.0 if topInset 0.0 topInset 0.0 if sideInset 0.0 sideInset 0.0 imageScrollView setContentInset UIEdgeInsetsMake topInset sideInset topInset.. 1 float topInset maxSize.height imageSize.height 2.0 float sideInset maxSize.width imageSize.width 2.0 if topInset 0.0 topInset 0.0 if sideInset 0.0 sideInset 0.0 imageScrollView setContentInset UIEdgeInsetsMake topInset sideInset topInset sideInset..

laying out images in UIScrollView automatically

http://stackoverflow.com/questions/6488169/laying-out-images-in-uiscrollview-automatically

from 0 CGPoint getImageOrigin NSInteger imageNumber CGFloat leftInset 30 CGFloat xOffsetBetweenOrigins 80 CGFloat topInset 20 CGFloat yOffsetBetweenOrigins 80 int numPerRow 3 CGFloat x leftInset xOffsetBetweenOrigins imageNumber numPerRow CGFloat.. yOffsetBetweenOrigins 80 int numPerRow 3 CGFloat x leftInset xOffsetBetweenOrigins imageNumber numPerRow CGFloat y topInset yOffsetBetweenOrigins floorf imageNumber numPerRow CGPoint imageOrigin CGPointMake x y return imageOrigin The origin being.. same row. So if I set it to 80 and my image is 50px wide there will be a 30px gap between two images in the same row. topInset is like left inset. It is the distance from the top edge of the view to the top edge of the images in the top row. yOffsetBetweenOrigins..