IOS代碼筆記之文字走馬燈效果
更新時間:2016年07月06日 09:50:55 作者:情深雨蒙
這篇文章主要為大家詳細(xì)介紹了IOS實現(xiàn)文字走馬燈效果的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了IOS文字走馬燈效果具體實現(xiàn)代碼,供大家參考,具體內(nèi)容如下
一、效果圖
二、工程圖
三、代碼
RootViewController.h
#import <UIKit/UIKit.h> @interface RootViewController : UIViewController @end
RootViewController.m
#import "RootViewController.h" #import "UXLabel.h" @interface RootViewController () @end @implementation RootViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. UXLabel* label=[[UXLabel alloc] initWithFrame:CGRectMake(50, 100, 100, 30)]; label.backgroundColor=[UIColor redColor]; label.stringColor=CGRectMake(0, 0, 0, 1); label.string=@"親愛的,你好嗎?"; label.stringFont=18.0; [self.view addSubview:label]; [label updateLabel]; }
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- iOS實現(xiàn)知乎和途家導(dǎo)航欄漸變的文字動畫效果
- IOS中一段文字設(shè)置多種字體顏色代碼
- iOS - UIButton(UIEdgeInsets)/設(shè)置button上的文字和圖片上下垂直居中對齊
- iOS應(yīng)用中UILabel文字顯示效果的常用設(shè)置總結(jié)
- iOS中的UITextView文字輸入光標(biāo)使用技巧小結(jié)
- iOS實現(xiàn)文字轉(zhuǎn)化成彩色文字圖片
- IOS繪制動畫顏色漸變折線條
- iOS中修改UITextField占位符字體顏色的方法總結(jié)
- 總結(jié)iOS實現(xiàn)漸變顏色的三種方法
- iOS文字漸變色效果的實現(xiàn)方法
相關(guān)文章
searchDisplayController 引起的數(shù)組越界處理辦法
這篇文章主要介紹了searchDisplayController 引起的數(shù)組越界處理辦法,需要的朋友可以參考下2015-07-07