문제

Uibarbuttonitem을 만들고 Self.navigationItem.rightbarbuttonitem을 항목에 설정했습니다.

그러나 Barbuttonitem의 너비 속성을 설정하는 것은 버튼의 너비에 영향을 미치지 않는 것 같습니다 (Barbutton의 너비를 줄이려고 노력하고 있습니다).

Uibarbuttonitem의 사용자 정의보기를 사용하면보기의 너비를 설정할 수 있습니다 (그리고 그 결과 Barbutton의 너비가 설정됩니다).

그러나 표준 uibarbuttonitem의 모양과 느낌을 얻고 싶습니다.

사용자 정의보기를 사용하지 않고 Uibarbuttonitem의 너비를 줄이는 방법을 아는 사람이 있습니까? (또는 Uibarbuttonitem처럼 보이는 Uiview 또는 Uibutton을 만드는 방법을 아는 사람이 있습니까?

도움이 되었습니까?

해결책

Looks like Apple really don't want it (Human Interface Guidelines). However there is a somewhat static solution if you use your own view for it:

Just use images instead... use grab to copy the images from IB at the widths you want. Then they'll look exactly like the UIBarButtons

Apple shows you how to map two different images (and in this example functions as well) to the same button depending on the state... check out the "Add Music" sample code: http://developer.apple.com/iphone/library/samplecode/AddMusic/index.html

This is from TechGuru @ http://discussions.apple.com/thread.jspa?messageID=9822548

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top