2016-08-16 2 views
3

내 Tabbar가 지금보고있는 방법입니다. 이 벨 아이콘의 오른쪽 상단을 겹치도록UITabBarItem 배지 위치를 변경하는 방법은 무엇입니까?

enter image description here

어떻게 그 배지를 이동하는 방법은 무엇입니까? 어떤 도움을 주셔서 감사합니다.

+0

이 볼에서 시작 http://stackoverflow.com/questions/24236823/how-to-adjust-tab-bar-badge- 위치 –

+0

가능한 [iOS 7 UITabBar 배지 위치]의 복제본 (http://stackoverflow.com/questions/19165671/ios-7-uitabbar-badge-position) – chrs

답변

5

이 시도 :

func repositionBadge(tabIndex: Int){ 

    for badgeView in self.tabBarController!.tabBar.subviews[tabIndex].subviews { 

     if NSStringFromClass(badgeView.classForCoder) == "_UIBadgeView" { 
      badgeView.layer.transform = CATransform3DIdentity 
      badgeView.layer.transform = CATransform3DMakeTranslation(-17.0, 1.0, 1.0) 
     } 
    } 
} 

에주의를 tabIndex를 1

+2

주의 :이 API는 비공개 API를 사용하므로 Apple에서 앱 사용을 거부 할 수 있습니다. 이. – Louis

관련 문제