-3
나는 신축성있는 뒤로 버튼을 원한다. 나는 지금이 코딩 라인을 사용하고있다. 이것은 나에게 뒤로 버튼을주는 것이지만 나는 코드에서이 라인을 추가하려고했기 때문에 그것을 사용자 정의 타이틀과 함께 늘릴 수있다.BackButton Stretchable
[button setTitle:@"back" forState:UIControlStateNormal];
그러나 그것이 늘릴 수 있도록 내가 내 제목을 필요의를 표시 내비게이션 바에서
UIImage *buttonImage = [[UIImage imageNamed:@"backButton.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 16, 0, 16)];
//create the button and assign the image
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:buttonImage forState:UIControlStateNormal];
//buttonImage.size.width
//set the frame of the button to the size of the image (see note below)
button.frame = CGRectMake(0, 0, buttonImage.size.width, buttonImage.size.height);
[button addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
//create a UIBarButtonItem with the button as a custom view
UIBarButtonItem *customBarItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.leftBarButtonItem = customBarItem;
를 작동하지 않았다?
어떻게 작동하지 않습니까? 스크린 샷을 게시 할 수 있습니까? –
@AshFurrow 첫 번째 게시물의 스크린 샷! – Jones
-1 이것은 심지어 질문이 아닙니다. 그 성명서 – Vikings