iOS 8의 UISearchBar 안의 취소 버튼의 텍스트 글꼴과 색상을 변경하고 싶습니다. iOS 6 및 7 용 솔루션을 이미 시도했지만 작동하지 않는 것 같습니다.UISearchBar에서 UIBarButtonItem 변경
답변
이것은 내가 찾던 해결책이 아니었지만 효과가있었습니다.
//The tintColor below will change the colour of the cancel button
searchBar.tintColor = UIColor.blueColor()
그러나 우리는 주제에 있지만이 또한 유용하다 :
let cancelButtonAttributes: NSDictionary = [NSFontAttributeName: FONT_REGULAR_16!, NSForegroundColorAttributeName: COLOR_BLUE]
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, forState: UIControlState.Normal)
이 작품 !!!!!! –
감사합니다. –
이것은 나를 위해 또한 일하고있다. font 속성 및 상수를 제거한 swift 2의 부 개정. - 은 cancelButtonAttributes을 보자있는 NSDictionary = [NSForegroundColorAttributeName : UIColor.blackColor()] UIBarButtonItem.appearance() setTitleTextAttributes (같은 cancelButtonAttributes [문자열 : AnyObject, forState : UIControlState.Normal?) – ekill
당신이 찾고있는 무엇이다
searchBar.placeholder = "Placeholder"
//The barTintColor changes the colour of the flashing text indicator
searchBar.barTintColor = UIColor.redColor()
//This sets the cancel button to show up
searchBar.setShowsCancelButton(true, animated: true)
//This makes the searchBar become active
searchBar.becomeFirstResponder()
- 1. UIBarButtonItem 색상 변경
- 2. iOS - UIBarButtonItem 높이 변경
- 3. 변경 UIBarButtonItem 뒤로 버튼
- 4. UIBarbuttonItem textColor 변경
- 5. UIBarButtonItem 제목 변경 - iPhone SDK
- 6. UIBarButtonItem
- 7. UIBarButtonItem
- 8. UIBarButtonItem
- 9. UISearchBar에서 동작 트리거
- 10. UISearchBar에서 터치 감지
- 11. UISearchBar에서 일부 결과 숨기기
- 12. uisearchbar에서 키보드를 무시하는 방법?
- 13. UIBarButtonItem : 애니메이션 중 제목 글꼴 색상 변경
- 14. UISearchBar에서 만든 UITableView를 숨기려면 어떻게합니까?
- 15. UISearchbar에서 키보드를 취소하는 방법은 무엇입니까?
- 16. UISearchBar에서 라이브 검색을 끄는 방법
- 17. UISearchbar에서 취소 버튼을 만드는 방법
- 18. UISearchBar에서 마스크 작업을 마친 이유
- 19. UISearchbar에서 악센트를 관리하는 방법은 무엇입니까?
- 20. uisearchbar에서 DropDownComobo를 추가하는 방법 ios
- 21. UISearchBar에서 취소 단추를 재정의하는 방법
- 22. 투명도가있는 UIBarButtonItem
- 23. uibarbuttonitem tintColor
- 24. 테두리가없는 UIBarButtonItem
- 25. UIBarButtonItem setTintColor iOS6의에서 iOS7에
- 26. UIBarButtonItem 이미지 제거
- 27. 지정은 UINavigationController 및 UIBarbuttonItem
- 28. 툴바에서 UILabel (UIBarButtonItem)의 텍스트를 프로그래밍 방식으로 변경
- 29. UIBarButtonItem 식별자를 프로그램 적으로 변경 (초기화하지 않음) 하시겠습니까?
- 30. UIBarButtonItem - 배경을 변경하고이 사용하여 텍스트
당신은 당신이 무엇을 시도했다 우리를 게재 할 수 있습니까? – Emil