您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
02 買粉絲怎么制作橫屏長圖文(買粉絲怎么制作橫屏長圖文)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-06-20 13:21:12【】6人已围观
简介@synthesizebutton3;@synthesizebutton4;@synthesizebutton5;@synthesizebutton6;-(void)willAnimateSe買粉絲n
@synthesize button3;
@synthesize button4;
@synthesize button5;
@synthesize button6;
-(void)willAnimateSe買粉絲ndHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation ration:(NSTimeInterval)ration
{
UIInterfaceOrientation to=self.interfaceOrientation;
if(to == UIInterfaceOrientationPortrait || to == UIInterfaceOrientationPortraitUpsideDown)
{
button1.frame = CGRectMake(20, 20, 125, 125);
button2.frame = CGRectMake(175, 20, 125, 125);
button3.frame = CGRectMake(20, 168, 125, 125);
button4.frame = CGRectMake(175, 168, 125, 125);
button5.frame = CGRectMake(20, 315, 125, 125);
button6.frame = CGRectMake(175, 315, 125, 125);
}
else
{
button1.frame = CGRectMake(20, 20, 125, 125);
button2.frame = CGRectMake(20, 155, 125, 125);
button3.frame = CGRectMake(177, 20, 125, 125);
button4.frame = CGRectMake(177, 155, 125, 125);
button5.frame = CGRectMake(328, 20, 125, 125);
button6.frame = CGRectMake(328, 155, 125, 125);
}
}
還需要修改- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation的代碼:
修改后為:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait
|| interfaceOrientation == UIInterfaceOrientationLandscapeLeft
|| interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
然后在dealloc中釋放資源:
- (void)dealloc
{
[button1 release];
[button2 release];
[button3 release];
[button4 release];
[button5 release];
[button6 release];
[super dealloc];
}
到此代碼部分搞定,然后就是連接控制器和視圖了。這點應該比較簡單了。呵呵!
然后Build and Go最終結果為:
3.切換視圖
這種方法使用于比較復雜的界面,是需要分別設計橫向模式和縱向模式,然后在使用的過程中自動切換。
當然了這個也需要確定輸出口和一些方法了。
首先定義輸出口:
(簡單描述,設計兩個視圖,一個定義為landscape,一個是portrait,一個為320x460,一個為480x300,每一個輸出口分別和每個視圖中的按鈕想關聯)
//用于切換的兩個View
IBOutlet UIView *landscape;
IBOutlet UIView *portrait;
//Foo兩個View中的Foo按鈕
IBOutlet UIButton *landscapeFooButton;
IBOutlet UIButton *portraitFooButton;
//Bar兩個View中的Bar按鈕
IBOutlet UIButton *landscapeBarButton;
IBOutlet UIButton *portraitBarButton;
還需要File's Owner和兩個View想關聯。按住Ctrl將File's Owner拖到Portrait上面,在彈出灰色菜單上選擇Portrait同理選擇Landscape。然后在按住Ctrl將File's Owner拖到Landscape上面,在彈出的灰色菜單上選擇View,讓Landscape為自啟動View。
然后是方法的實現:
-(void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)to ration:(NSTimeInterval)ration
{
if(to == UIInterfaceOrientationPortrait)
{
self.view = self.portrait;
self.view.transform = CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degressToRadian(0));
self.view.bounds = CGRectMake(0.0, 0.0, 320.0, 460.0);
}
else if (to == UIInterfaceOrientationLandscapeLeft)
{
self.view = self.landscape;
self.view.transform = CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degressToRadian(-90));
self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0);
}
else if (to == UIInterfaceOrientationPortraitUpsideDown)
{
self.view = self.portrait;
self.view.transform = CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degressToRadian(180));
self.view.bounds = CGRectMake(0.0, 0.0, 320.0, 460.0);
}
else if (to == UIInterfaceOrientationLandscapeRight)
{
self.view = self.landscape;
self.view.transform = CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degressToRadian(90));
self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0);
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
不要忘了在dealloc中釋放資源哦。
因為在上面的代碼中使用到了Core Graphics框架,因此要把該框架連接到該項目中,具體的方法是:在Resources上面點右鍵Add->Existing Frameworks。然后就是查找路徑了。我第一次就看錯了沒有找到,哎,做事情不下心呀!具體路徑為:/Developer/Platforms /iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System /Library/Frameworks/CoreGraphics.framework 呵呵,這個路徑是有點長不好找,記住不是在:/Developer/SDKs里面了,我剛開始就是找到呢里面了。呵呵!還有就是導入后會處理一個提示框, 不要Copy,Reference Type要選擇Relative to Current SDK然后add就OK了。
例子中還有一個方法是對View中的按鈕實現隱藏的,這個就比較簡單了!
具體方法為:
-(IBAction)buttonPressed:(id)sender
{
if(sender == portraitFooButton||sender == landscapeFooButton)
{
portraitFooButton.hidden=YES;
landscapeFooButton.hidden=YES;
}
else
{
portraitBarButton
很赞哦!(383)
相关文章
- youtube music free music appshare(英文翻譯~~謝謝~~)
- 01 01 幫粉絲到4s店買車(在去4S店準備購車的時候,要小心銷售人員的哪些套路?)
- youtube music pc app downloader下載(為什么我用Youtube Downloader HD 最新版的軟件 去下載Youtube 上的視頻 我把地址復制上去后)
- 01 01 幫粉絲買藥(新型農村合作醫療保險可以報銷乙肝抗病毒藥嗎!怎么報銷啊!這藥太貴了!幫幫忙!)
- 01 01 幫粉絲買車真實視頻(為何五百多萬粉絲如此喜歡李子柒?)
- youtube music mp3 download apple music(求官方viva la vida mv)
- 01 01 幫粉絲砍價買車寶馬一系(二手車販子利潤有多少?)
- youtube music free download for android(youtube music下載的文件在哪里)
- youtube music ios(ios16音樂播放器變小了)
- youtube music pc app store怎么切換賬號 mac(幫忙翻譯一段IPHONE廣告)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片
职业:程序员,设计师
现居:湖南怀化芷江侗族自治县
工作室:小组
Email:[email protected]
热门文章
站长推荐
01 01 開通櫥窗賣貨都是粉絲買的嗎(抖音粉絲一千開通商品櫥窗能賣貨嗎)
01 01 幫粉絲解決買車問題的主播(向粉絲要錢、隱瞞女友、合約風波,被罵上熱搜的他,怕是又要糊了么?)
01 01 怎么看我粉絲愛買什么(請問怎么查看關注我的淘寶店鋪的粉絲啊)
youtube music heaven song(關于<街舞新曲>/<昏迷二十年>電影原聲的問題)
01 01 幫粉絲買翡翠手鐲市場視頻(快手翡翠雕刻光頭哥賣的是真的嗎)
01 01 幫粉絲買的手鐲(抖音一只小強帶人買手鐲是真的嗎)
youtube music pc apple官網登錄入口(如何讓YTmusic在后臺播放)
01 01 怎么有粉絲去櫥窗里面買東西(抖音櫥窗商品傭金是粉絲買還是都可以買)