Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
How to position many UIImage in a UIView with a specified space
Hi, I have a quite complex question (at least for me): I have to handle some UIImage in a UIView but I want to put all those images at a determined distance between them (it's the shelf for a magazine app). Here is the code with the images:
Define the spacing on the left and right, the spacing on the very top and bottom, and the space between two vertical images. Enumerate through your images, determine if the image number is odd or even. If odd, it's an image on the left. If it's even, it's an image on the right. For the x position, use totalWidth - spacing on the right - width of image. For every 2 images, you go through, add 1 to an int called row that initially starts at 1. For the y, multiply the row by the vertical spacing and then add the very top spacing.
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.
Well if your images are in an array, they have an index number. And now that I think about, you'd have to add 1 to index for my method to work. To check if this index number is odd or even you'd use %. The result will be the remainder of the division. So if x divided by 2 has a remainder, we know it's odd, if it doesn't, it's even.
if (x % 2 == 0) { //x is even } else { //x is odd }
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.
ah ok, but I'm not using an array: I have a .plist file on the web and in every item there's the url for the image to display, because in the final project the covers will be uploaded online every month. So the only code that I use is the one in the first post... I have never used an array, do I need to use one in this project? Thank you again :)
ok, I looked my plist a bit deeper and it's an array and every item is called "dict". but, to be honest, I haven't understood mostly of what you said: HOW and where to use the array's method? :confused: :confused:
couldn't you take a look to my project I'm sure that it's very easy for you, but I'm new with all this stuff and I'm really lost!
Sorry, but I'm not going to look at your project unless I'm getting paid. You'd probably create the array of images from your plist in viewDidLoad. But you'll have to implement lazy loading. Cocanetics has a UIImageView subclass for that: And Now Lazy Loading with NSURLConnection | Cocoanetics
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.
Replies
New app - See screenshots and details at www.globaclock.com.
If you want to
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeNew app - See screenshots and details at www.globaclock.com.
If you want to
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeNew app - See screenshots and details at www.globaclock.com.
If you want to
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomecouldn't you take a look to my project I'm sure that it's very easy for you, but I'm new with all this stuff and I'm really lost!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeNew app - See screenshots and details at www.globaclock.com.
If you want to
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome