목록에서 셀을 제거하는 "삭제"버튼이 있습니다. 해당 버튼을 클릭하면 내 botton이 "완료"로 이름이 바뀌어 편집을 완료하게됩니다. 도와주세요.클릭시 UIButton 텍스트 변경
-2
A
답변
1
이 시도 :
- (void)viewDidLoad
{
[super viewDidLoad];
[self.btn setTitle:@"Delete" forState:UIControlStateNormal];
}
- (IBAction)deleteBtn:(id)sender
{
[UIView animateWithDuration:0.2 animations:^{
//Do your delete action here;
}completion:^(BOOL finished)
{
[self.btn setTitle:@"done" forState:UIControlStateNormal];
}];
}
+0
제목을 '완료'로 변경하면 버튼 제목에 '삭제'가 표시됩니까? 나는 당신의 코드에서 "삭제"가 viewdidload에만 작성 되었기 때문에 나는 아니오라고 생각한다. –
+0
요구 사항 만이 이와 같음. "삭제"버튼을 탭한 후 언급 한 내용을 "완료"로 변경해야합니다. –
0
- (void)viewDidLoad
{
[super viewDidLoad];
[self.btn setTitle:@"Delete" forState:UIControlStateNormal];
}
- (IBAction)deleteBtn:(id)sender
{
[UIView animateWithDuration:0.2 animations:^{
//Do your delete action here;
}completion:^(BOOL finished)
{
[sender setTitle:@"done" forState:UIControlStateNormal];
}];
}
관련 문제
- 1. UIButton 배경 변경 클릭시
- 2. 메뉴 클릭시 텍스트 변경
- 3. 클릭시 PowerPoint 텍스트 변경
- 4. UIButton 제목은 클릭시 숨김
- 5. jquery 클릭시 텍스트 색상 변경
- 6. 버튼 클릭시 앞뒤로 텍스트 변경
- 7. 클릭시 텍스트 영역 높이 변경
- 8. 버튼 클릭시 이클립스 변경 텍스트
- 9. 버튼 클릭시 선택한 텍스트 상자의 텍스트 변경
- 10. UIButton with stateselected 변경
- 11. UIButton 이미지 변경 버튼 위치 변경
- 12. jquery를 사용하여 클릭시 텍스트 영역 변경
- 13. JavaFX의 버튼 클릭시 TextBox의 텍스트 변경
- 14. jQuery- 버튼 클릭시 텍스트 색상 변경
- 15. 버튼 클릭시 텍스트 필드의 기능 변경
- 16. 클릭시 asp.net의 하이퍼 링크 텍스트 변경?
- 17. UIButton 이미지를 다른 UIButton 이미지보기로 변경
- 18. UIButton 지연된 상태 변경
- 19. UIButton 용 setHighlighted 변경
- 20. 어떻게 이미지를있는 UIButton 변경
- 21. UIButton 색상 변경
- 22. UIButton 배경색 변경
- 23. 변형 uibutton 높이 변경
- 24. UIButton 색상 변경
- 25. UIView에서 UIButton 클릭시 UIViewController를 여는 방법
- 26. UIButton 클릭시 UITextfield를 추가하고 편집 가능하게하는 방법
- 27. iOS의 UIButton 클릭시 문자열 값 전달
- 28. 업데이트 UITableView sectionHeaderHeight UIButton 클릭시 iOS에서 클릭
- 29. 변경 텍스트
- 30. UIButton 제목 텍스트 잘림
당신이 ... 이제까지'UIButton' 클래스 참조를 읽으려고 있나요? https://developer.apple.com/library/ios/documentation/uikit/reference/UIButton_Class/UIButton/UIButton.html – holex