1
모양 메서드 (> iOS 5.0)를 사용하여 UIBarButtonItem을 사용자 정의하려고합니다. UIControlStateNormal에는 정상적으로 작동하지만 강조 표시되거나 비활성화 된 것은 아닙니다. 참조 이미지다른 UIControlStates에 대해 모양이 작동하지 않는 UIBarButtonItem setBackgroundImage
여기 내가 그 설정하는 데 사용하는 코드 :
// now configure the UIBarButtonItems
UIImage *buttonBGInactive = [[UIImage imageNamed:@"button-navbar-30-inactive.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];
UIImage *buttonBGActive = [[UIImage imageNamed:@"button-navbar-30-pressed.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];
[[UIBarButtonItem appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setBackgroundImage: buttonBGInactive forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setBackgroundImage: buttonBGActive forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
어떤 아이디어? 이미지 자체는 30x30 픽셀이며 가로 모드는 필요하지 않습니다.
이것은 내 문제를 해결하지 못했습니다. – x89a10