Archive for 'Uiview'

/* Creating UIVIew and adding ScrollView to it and adding items to that ScrollView*/

// in .h File //
UIView *profileView;
UIScrollView *verticalScroll;

// in .m File //
-(void)show_{
// Create a UI View //
profileView = [[UIView alloc] init];
profileView.frame = CGRectMake(0, 0, 320, 480);
profileView.backgroundColor = [UIColor blueColor];
[[[CCDirector sharedDirector] openGLView] addSubview:profileView];

// Create a UIScroll View //
verticalScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 300, 420)];
verticalScroll.backgroundColor = [UIColor yellowColor];
verticalScroll.showsVerticalScrollIndicator = NO;
verticalScroll.contentSize = CGSizeMake(300, 760);
verticalScroll.center = CGPointMake(160, 250);
verticalScroll.pagingEnabled = FALSE;
[profileView addSubview:verticalScroll];

// Create and add an UIImageView to the ScrollView //
UIImageView *baseImg1 = [[UIImageView alloc] initWithFrame:CGRectMake(5, 20, 325, 65)];
baseImg1.image = [UIImage imageNamed:@"imageName.png"];
baseImg1.center =CGPointMake(150, 340);
[verticalScroll addSubview:baseImg1];
[baseImg1 release];

}

Incoming search terms:

  • ProfileView Create

You can use the following lines of code to make the view looks like a pop up with fade-In effect. For that, first create an UIVIew and assign its alpha value to zero. Here, my UIView is named as : ‘MyView’ :

// Function for FadeIn/PopUp effect for the UIView //

-(void)effectFunction_FadeIn{
MyView.transform = CGAffineTransformMakeScale(1.3, 1.3);
MyView.alpha = 0;
[UIView animateWithDuration:.35 animations:^{
MyView.alpha = 1;
MyView.transform = CGAffineTransformMakeScale(1, 1);
}];
}

 

Now, you can use the below code to make it disappear like a popout/ with Fade-Out effect:

-(void)effectFunction_FadeOut{
MyView.transform = CGAffineTransformMakeScale(1.3, 1.3);
MyView.alpha = 1;
[UIView animateWithDuration:.35 animations:^{
MyView.alpha = 0;
MyView.transform = CGAffineTransformMakeScale(1, 1);
}];
}

 

Incoming search terms:

  • disappear effect android

CALayer borders don’t support that behavior. The easiest way to accomplish what you want is adding an n-point-wide opaque subview with your desired border color as its background color on each side of your view.

For example:

                

Set custom border width for a uiview

[myView.layer setBorderWidth: 2.0];

Give border color to a uiview

[myView.layer setBorderColor: [[UIColor blueColor] CGColor]];

flip horizontal::

SecondViewController *myViewController=[[SecondViewController                                                     alloc]initWithNibName:@"SecondViewController"bundle:nil];[UIView beginAnimations:@"flipView"context:nil];[UIView setAnimationDuration:2];[UIView setAnimationCurve:UIViewAnimationCurveCaseInOut];[UIView setAnimationTransition:UIViewAnimationTransitionFlipfromLeft                            forview:self.view.cache:YES];[self.view addSubView:myViewController.view];[UIView CommitAnimations];

 

page curl::

SecondViewController *myViewController=[[SecondViewController                                                     alloc]initWithNibName:@"SecondViewController"bundle:nil];[UIView beginAnimations:@"flipView"context:nil];[UIView setAnimationDuration:2];[UIView setAnimationCurve:UIViewAnimationCurveCaseInOut];[UIView setAnimationTransition:UIViewAnimationTransitioncurlup                            forview:self.view.superViewcache:YES];[self.view removeFromSuper.view];[UIView CommitAnimations];

 

Incoming search terms:

  • phonegap android page turn curl

UIView with rounded corners in iphone.

// import quartz core 
#import 

// setting up size and position of the UIView
int leftPos = 20;
int topPos = 35;
int width = 150;
int height = 160;

// creating  view
UIView *yourView = [[UIView alloc] initWithFrame:CGRectMake(leftBorder, topBorder, width, height)];

// setting up rounded corners
yourView.layer.cornerRadius = 10;

// setting color for your view
yourView.backgroundColor = [UIColor greenColor];

// adding your new view on the
[self.view addSubview:yourView];

//Set Animation Properties

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration: 1];

//setting animation for the current view
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:YES];

//Next ViewController to push
nextPage *detailViewController = [[nextPage alloc] initWithNibName:@"nextPage" bundle:nil];

//Push the next viewcontroller to NavigationController
[self.navigationController pushViewController:detailViewController animated:NO];
[detailViewController release];

//Start the Animation
[UIView commitAnimations];

Incoming search terms:

  • ios pushviewcontroller animation
  • push transition uiview
  • xcode pushViewController animation finished
  • xcode self navigationcontroller pushviewcontroller:
We Can Build Your App for You. Lets Get Started !