Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Mobile-Applications uiscrollview add images
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
uiscrollview add images
2 Answer(s)      3 years and 2 months ago
Posted in : MobileApplications


How to add dynamic images to UIScrollView?


Advertisement
View Answers

July 27, 2011 at 4:19 PM


To add images to a scroll view, get those images in an array

NSArray *imageFilenames = [NSArray arrayWithObjects:@"abc.png","one.png",nil];

And then,

CGFloat contentOffset = 0.0f;

for (NSString *singleImageFilename in imageFilenames) 
{  
   CGRect imageViewFrame = CGRectMake(contentOffset,110.0f,scrollView.frame.size.width,_scrollView.frame.size.height-30.0f);
   UIImageView *imageView = [[UIImageView alloc] initWithFrame:imageViewFrame];
    imageView.image = [UIImage imageNamed:singleImageFilename];
    imageView.contentMode = UIViewContentModeCenter;
    [scrollView addSubview:imageView];
    [imageView release];
    contentOffset += _scrollView.frame.size.width;
    scrollView.contentSize = CGSizeMake(contentOffset, scrollView.frame.size.height);
}

scrollview.contentSize and imageViewFrame should be adjusted to our needs

Hope it helps,

-Dinny



March 24, 2012 at 6:35 PM


its really nice.. great job



Related Tutorials/Questions & Answers:
uiscrollview add images
uiscrollview add images  How to add dynamic images to UIScrollView
Add UIImageView to UIScrollVIew
. See the given code it might help you... Add UIImageView to UIScrollVIew - (id...Add UIImageView to UIScrollVIew  How can i add UIImageView to UIScrollview? I have already created both UIIMageView and ScrollView programmatically
Advertisements
UIScrollView Height
UIScrollView Height  How can i set the height and width of the UIScrollView according to my requirement. Actually i'm creating a login application form iPhone and using UIScrollView. Also i have number of item to add
uiscrollview background color
uiscrollview background color  Is it possible to set the uiscrollview background color in iPhone application
UIScrollView Toolbar problem
and drop the uiscrollview set the length as 320*460 Now, add the UIToolBar...UIScrollView Toolbar problem  Hi, I am creating a UINavigation based... or viewWillApear method just add the given lines of code. CGRect scrollFrame
uiscrollview setcontentoffset animated
uiscrollview setcontentoffset animated  Hi, What is actual code to call uiscrollview setcontentoffset animated method? Thanks   Hi, Here...   when and where i should use setcontentoffset UIScrollView
uiscrollview remove all subviews
uiscrollview remove all subviews  Hi, How to remove all elements from uiscrollview. I need code for uiscrollview remove all subviews. Thanks   Hi, You can use following code in your program to remove all sub childs
UIImageView UIScrollView Zoom
UIImageView UIScrollView Zoom   I am trying to implement a Zoomin / Zoomout feature in UIImageView and wanted to have the scroll capability init.   UIImageView *tempImage = [[UIImageView alloc]initWithImage:[UIImage
UIScrollView Example iPhone
UIScrollView Example iPhone UIScrollView is the superclass of several... need UIScrollView when our text length or form size is larger then the actual... out how to add scroll view to your application. You can accomplish
Images in java
Images in java  how to handle images in java
add
How to add two numbers in Java  add two number   Here is a java example that accepts two integer from the user and find their sum. import java.util.*; class AddNumbers { public static void main(String[] args
add
add two no in Java  Java Add Example that accepts two integer from the user and find their sum  Here is a java example that accepts two integer from the user and find their sum. import java.util.*; class AddNumbers
add
How to add two int numbers in Java Example  How to add two int numbers in Java Example  Here is a java example that accepts two integer from the user and find their sum. import java.util.*; class AddNumbers
add
Java Example to add two numbers  Java Example to add two numbers  Here is a java example that accepts two integer from the user and find their sum. import java.util.*; class AddNumbers { public static void main
add
Java Program to add two numbers  Java Program to add two numbers  Here is a java example that accepts two integer from the user and find their sum. import java.util.*; class AddNumbers { public static void main
Moving The Images
Moving The Images  How to moving multiple images in one frame using swings
inked images
inked images  How do I eliminate the blue border around linked images
images upload
images upload  I use netbeans IDE 6.8 How i upload any image from any folder to web page
jsp images
jsp images  hi I had done a demo application using jsp. And i tried to display some images which is located in the server folder. It has done by using the IP address path of that image folder.. It has been success full in IE
Adding images in itext pdf
Adding images in itext pdf  Hi, How to add image in pdf file using itext? Thanks   Hi, You can use following code: PdfWriter.getInstance(document,new FileOutputStream("imagesPDF.pdf")); Read more at Inserting
Moving Images in GUI - Swing AWT
Moving Images in GUI  I want to add an image of a person in my GUI and make it move to a specific location. How can I add the image to the frame and move
insert images into a Mysql database
insert images into a Mysql database  How can I insert images into a Mysql database
HTML background images
HTML background images  How can I specify background images
Sending images through java mail
Sending images through java mail  Am trying to develop greeting application that having images..... in one jsp page i displayed all images and by clicking one image the control go to mail sending page in that the image should add
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
background images in css not working
background images in css not working  In the application i'm passing a background image from CSS in the given format ... background-image: url... of adding background images in css
Blob images - JSP-Servlet
Blob images  Hi sir how can i retrieve blob images from database using jsp from mysql  Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/retrieve-image.shtml Hope that it will be helpful
java mail sending with images
java mail sending with images  I need to send images through java mail without giving content path(i.e. we don't want hard code the image path)can you tell me the idea?   Please visit the following links: http
regarding images in jsp
regarding images in jsp  Hi, When I am trying to display an image in jsp, i am getting the image of bar charts in webroots/jspchart/web/jspbarchart.jsp.. But actually I am not getting any image in the browser.. Can any one help
 

 

 

DMCA.com