How can I sl开发者_开发技巧ide text from left to right in iPhone ?
[label setFrame:CGRectMake(278, 32, 42, 29)]; // Right most position
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[label setFrame:CGRectMake(0, 20, 42, 29)]; //left most position
[UIView commitAnimations];
you can use UIView animation on the Label's position:
[UIView beginAnimations];
CGRect fr = label.frame;
fr.origin.x = target_x_position;
label.frame = fr;
[UIView commitAnimation];
For this you need to use either UILabel or UITextView inside the scroll View. Generate the Scroll view having the necessary width and add UITextView as addSubView to this Scroll view.
<UIScrollViewDelegate> //set the delegate of ScrollView to call it's delegate methods and allow paging to be done in ScrollView.
-(void)ScrollViewdidScroll:(UIScrollView *)UIScrollV
{
}
精彩评论