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



Home Answers Viewqa Mobile-Applications Add UIImageView to UIScrollVIew
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
Add UIImageView to UIScrollVIew
1 Answer(s)      2 years and 4 months ago
Posted in : MobileApplications


How can i add UIImageView to UIScrollview? I have already created both UIIMageView and ScrollView programmatically and added it the view. as given below..

[self.view addSubview:myScrollView];

But still my image view is not visible..why?


Advertisement
View Answers

June 8, 2012 at 5:07 PM


sometimes it may occurs when we forget to add the image view to scrollview. So, make sure that you have added the scrollview to uiview and your image view is added to the scroll view. See the given code it might help you...

Add UIImageView to UIScrollVIew

- (id) init
{
    if(self = [super init])
    {
        scroll = [[UIScrollView alloc] init];
        scroll.scrollEnabled = YES;
        scroll.pagingEnabled = YES;
        scroll.directionalLockEnabled = YES;
        scroll.showsVerticalScrollIndicator = NO;
        scroll.showsHorizontalScrollIndicator = NO;
        scroll.delegate = self;
        scroll.backgroundColor = [UIColor blueColor];
        scroll.autoresizesSubviews = YES;
        scroll.frame = CGRectMake(0, 0, 320, 480);
        [self.view addSubview:scroll];

        view1 = [[UIImageView alloc] init];
        [scroll addSubview:view1];

        view2 = [[UIImageView alloc] init];
        [scroll addSubview:view2];
    }

    return self;
}


Related Tutorials/Questions & Answers:
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
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
Advertisements
uiscrollview add images
uiscrollview add images  How to add dynamic images to UIScrollView
UIIMageView Add Image
UIIMageView Add Image "initWithImage" is a image declaring method that is used to declare the image while while creating a UIImageView. Syntax..."]; //creating a UIImageView UIImageView *imageView1 = [[[UIImageView
detect tap on uiimageview
detect tap on uiimageview  detect tap on uiimageview UIScrollView. Thanks
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
UIImageView set Image URL
UIImageView set Image URL  Show image by URL   UIImageView set image url Create NSURL object and add the Image URL to it. Create NSData and add the NSURL object to it. Now, create UIImage and pass the NSData value
UIImageView Collision Detection
UIImageView Collision Detection  Is there any way to detect UIImageView Collisions in Objective C? Thanks
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
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
add imageview to uiview
:[UIImage imageNamed:@"imageName.png"]];    You need to add a UIImageView to UIView Add an Image or Image URL to your ImageView. Code: UIImageView...add imageview to uiview  i want to add an image to UIView background
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
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
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
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
Add Employee
Add Employee  coding for adding an employee
add to cart
add to cart  sir, i want to do add to cart to my shopping application each user using sessions. Plz help thnaks in advance
add
How to add
How to add   Hi, I want to make a website which will recommend users books according to the genre selected by them. I am using PHP, JavaScript and mySQL. The problem is that there will me almost more than 100 books
Add a fram
Add a fram  I want to put an image on frame on my GUI(Net Beans).please tell me the way to put this. only for frame.. thanks and regards, Rahul Dubey   Here is an example that displays an image on jframe. import
add uibarbuttonitem to uinavigationbar
add uibarbuttonitem to uinavigationbar  add uibarbuttonitem to uinavigationbar
Add multiple UIBarButtonItem
Add multiple UIBarButtonItem  add multiple uibarbuttonitem
How to add JTable in JPanel
How to add JTable in JPanel  How to add JTable in JPanel
how to add to numbers in java
how to add to numbers in java  how to add to numbers in java
uinavigationcontroller add multiple buttons
uinavigationcontroller add multiple buttons  How to add multiple buttons to the UINavigationController
add new package java
add new package java  How to add new package in Java
sql add comment to column
sql add comment to column  Sql query to add comments to column
Advertisements
 

 

 

DMCA.com