2011-03-22 254 views

回答

4
[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]; 
4

您可以在标签的位置使用的UIView动画:

[UIView beginAnimations]; 
CGRect fr = label.frame; 
fr.origin.x = target_x_position; 
label.frame = fr; 
[UIView commitAnimation]; 
0

为此,您需要为使用的UILabel或UITextView的滚动视图内。 生成具有必要宽度的Scroll视图并将UITextView作为addSubView添加到此滚动视图。

<UIScrollViewDelegate> //set the delegate of ScrollView to call it's delegate methods and allow paging to be done in ScrollView. 

-(void)ScrollViewdidScroll:(UIScrollView *)UIScrollV 
{ 

}