본문 바로가기
반응형

프로그램/iOS17

iOS 동적 라벨에 따라서 cell 높이 변경 Array 속 Dictionary 에서 라벨을 읽어와 라벨의 최소 최대 크기를 주고 다시 Dictionary에 setObject하여 cell 높이 값을 준다. TableCell.m 파일에서 static UILabel* eLabel = nil ; + (CGSize)SizeWithDic:(NSDictionary *) dic { //폰트 크기 및 사이즈 정렬 라인을 0으로 해줘야한다. if( eLabel == nil ) { eLabel = [UILabel new] ; eLabel.font = [UIFont systemFontOfSize:12.0f weight:UIFontWeightRegular] ; eLabel.lineBreakMode = NSLineBreakByCharWrapping ; eLabel.numb.. 2016. 2. 19.
iOs UILabel, UIButton 색상, 폰트, 글자체 변경 //라벨self.Label.text =@"" //라벨 텍스트 입력 [self.Label setTextColor:UIColorFromRGBA(0x009cff, 1)]; //라벨 색상입력 [self.Label setFont:[UIFont fontWithName:@"SFUIDisplay-Regular" size:15.0f]]; //폰트 글크기 //버튼[self.Button setTitle:@"값넣기" forState:UIControlStateNormal]; //버튼 라벨 입력 [self.Button setTitleColor:UIColorFromRGBA(0x005cff, 1) forState:normal]; //버튼 라벨 색상 입력 [self.Button setBackgroundColor: UIColorFrom.. 2016. 2. 19.
iOS UIalertView 사용법 테이블 뷰에다가 alert를 사용할때는 태그값이 필요할수도 있다. 버튼 하나만 사용하고 싶으면 @"취소" 부분을 nil 하여주면 됨 UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"타이틀 제목" message:@"말할 메세지" delegate:self cancelButtonTitle:@"취소"otherButtonTitles:@"확인", nil];alert.tag = 1 [alert show]; //밑에것은 alert 클릭시 타는 부분-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ NSLog(@"alertView : %ld , %d", button.. 2016. 2. 19.
iOS 동적 Uiview 생성하기 일단 동적으로 생성할 UIview를 생성하여 작업을 한 뒤 uiview.m 파일 - (instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { [self initCustomView]; } return self;}- (instancetype)initWithCoder:(NSCoder *)coder{ self = [super initWithCoder:coder]; if (self) { [self initCustomView]; } return self;} -(void)initCustomView{ [[NSBundle mainBundle]loadNibNamed:@"VIewName" owner:self option.. 2016. 2. 19.
iOS UI 이미지 변경 및 색상 변경 색상 변경을 위해 메소드를 찾아보면 아래와 같이 나온다. 하지만 우리가 알고 있는 색상은 #ffffff , 009deff 등등 RGB식으로 알때 아래 메소드 들은 사용할 수가 없다...공통모듈로 만들어 놓은뒤 사용하여 쓴다. #define UIColorFromRGBA(rgbValue, rgbAlpha)[UIColor colorWithRed:((float)(((rgbValue) & 0xFF0000) >> 16))/255.0green:((float)(((rgbValue) & 0xFF00) >> 8))/255.0 blue:((float)((rgbValue) & 0xFF))/255.0 alpha:(rgbAlpha)] [self.Gradation setBackgroundColor: UIColorFromRGBA(0.. 2016. 2. 19.
반응형