기본 콘텐츠로 건너뛰기

3월, 2019의 게시물 표시

objc, constraint, programmatically, ex

[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.subview1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0]];                 [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.lblTermsOfUse attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.subview2 attribute:NSLayoutAttributeTop multiplier:1 constant:20]];

Kotlin, Calendar, Date

private fun getFirstWeek (year:Int , month:Int):Int{ var strMonth = "0" if (month < 10 ) strMonth += month else strMonth = month.toString() var strDate = year.toString() + strMonth + "01" val format = SimpleDateFormat( "yyyyMMdd" ) val date = format.parse(strDate) val calendar = Calendar.getInstance() calendar. time = date return calendar.get(Calendar. DAY_OF_WEEK ) } private fun getWeekStr (week:Int):String{ when (week){ 1 -> return "日" 2 -> return "月" 3 -> return "火" 4 -> return "水" 5 -> return "木" 6 -> return "金" 7 -> return "土" } return "" }