簡體   English   中英

模仿 iOS GameCenter UI?

[英]Mimic iOS GameCenter UI?

我想知道我們如何模仿 iOS 游戲中心應用程序的 UI? 它有一個非常酷的界面。 我想知道他們是如何繪制文本的,自定義標簽欄 Controller 等。

創建像 Game Center 這樣的自定義 UITabBarController 可能是所有 iOS 自定義技術中最難的,並且很可能需要從頭開始構建完整的自定義組件。 不幸的是,Apple 不希望您過多地使用 UITabBarController。

請參閱此答案iOS TabBar Image assignment了解如何更改標簽欄的色調顏色。

rest 相當簡單,可以在此處找到有關 UINavigationBar 的自定義 UINavigationItem 和基本的 UIWebView 和 UILabels 將幫助您實現其他一切。

希望這可以幫助

我發現最好的方法是創建自己的標簽欄 controller。

雖然它不是微不足道的,但一旦你嘗試它就很簡單。 對於“標簽欄”,我使用了普通的 UIView。 在 UIView 內,我放置了一個 UIImageView(用於保存標簽欄背景圖像——可以是任何你想要的)和幾個 UIButton(對於每個標簽按鈕——非常可定制,因為每個都是 UIButton)。 這樣做可以讓您在標簽欄外觀方面做任何您想做的事情。

您可以使用此技巧自定義導航欄背景

-(void)styleNavBar:(CGImageRef)backgroundImage
{
    navBar.layer.contents = (id)backgroundImage ;
}

此外,對於自定義導航欄按鈕:

UIButton * customButton ; // your custom left or right nav bar button

// put it into a bar button item:
UIBarButtonItem * barButtonItem = [ [ UIBarButtonItem alloc ] initWithCustomView:customButton ] ;

這應該是一個好的開始!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM