iphone Programming Glossary: imagenumber
laying out images in UIScrollView automatically http://stackoverflow.com/questions/6488169/laying-out-images-in-uiscrollview-automatically on the image number. Something like this where i is the image number starting from 0 CGPoint getImageOrigin NSInteger imageNumber CGFloat leftInset 30 CGFloat xOffsetBetweenOrigins 80 CGFloat topInset 20 CGFloat yOffsetBetweenOrigins 80 int numPerRow.. 80 CGFloat topInset 20 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.. 3 CGFloat x leftInset xOffsetBetweenOrigins imageNumber numPerRow CGFloat y topInset yOffsetBetweenOrigins floorf imageNumber numPerRow CGPoint imageOrigin CGPointMake x y return imageOrigin The origin being calculated here is the upper left corner..
|