UIButton.addTarget(self, action: #selector(self.eventFunction), for: .touchUpInside)


@IBAction func buttonEvent() {

  //your code

  print("buttonEvent")

}

'swift' 카테고리의 다른 글

UITextField password  (0) 2018.03.21
UiTextField only english  (0) 2018.03.21
UITextview 스크롤 최상위 부터 보기  (0) 2018.03.21
textField border style none, textField font 크기 변경  (0) 2018.03.13
textField, textView  (0) 2018.03.13

let contentHeight = yourUITextView.contentSize.height

let offSet = yourUITextView.contentOffset.x

let contentOffset = contentHeight - offSet


yourUITextView.contentOffset = CGPoint(x: 0, y: -contentOffset)

'swift' 카테고리의 다른 글

UiTextField only english  (0) 2018.03.21
UiButton 이벤트 적용  (0) 2018.03.21
textField border style none, textField font 크기 변경  (0) 2018.03.13
textField, textView  (0) 2018.03.13
네비게이션 바 색상 변경  (0) 2018.03.13

보더 스타일

textField.border.style = .none


폰트 크기

textField.font = UIFont(name: textField.font!.fontName, size: 14)

'swift' 카테고리의 다른 글

UiTextField only english  (0) 2018.03.21
UiButton 이벤트 적용  (0) 2018.03.21
UITextview 스크롤 최상위 부터 보기  (0) 2018.03.21
textField, textView  (0) 2018.03.13
네비게이션 바 색상 변경  (0) 2018.03.13

텍스트 필드

textField.isUserInteractionEnabled = false


텍스트 뷰

textView.isUserInteractionEnabled = false

'swift' 카테고리의 다른 글

UiTextField only english  (0) 2018.03.21
UiButton 이벤트 적용  (0) 2018.03.21
UITextview 스크롤 최상위 부터 보기  (0) 2018.03.21
textField border style none, textField font 크기 변경  (0) 2018.03.13
네비게이션 바 색상 변경  (0) 2018.03.13

navigationController?.navigationBar.barTintColor = UIColor.Red

'swift' 카테고리의 다른 글

UiTextField only english  (0) 2018.03.21
UiButton 이벤트 적용  (0) 2018.03.21
UITextview 스크롤 최상위 부터 보기  (0) 2018.03.21
textField border style none, textField font 크기 변경  (0) 2018.03.13
textField, textView  (0) 2018.03.13


public static Bitmap getBitmapFromVectorDrawable(Context context, int drawableId) {
Drawable drawable = ContextCompat.getDrawable(context, drawableId);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
drawable = (DrawableCompat.wrap(drawable)).mutate();
}

Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);

return bitmap;
}


'android' 카테고리의 다른 글

안드로이드 UI 라이브러리 모음  (0) 2019.03.05
setDisplayShowCustomEnabled 뒤로 가기 색상 변경  (0) 2018.10.30
pendingIntent Flag 옵션  (1) 2018.02.02
TextView 선택 복사  (0) 2018.01.19
비트맵 파일로 떨어트리기  (0) 2017.12.14

  public static String addDate(String fromDate, String format, int addYear, int addMonth, int addDate, int addHour, int addMinute, int addSecond) throws ParseException {

    SimpleDateFormat sdf = new SimpleDateFormat(format);

    Date date = sdf.parse(fromDate);

    Calendar cal = new GregorianCalendar();


    cal.setTime(date);

    cal.add(Calendar.YEAR, +addYear);

    cal.add(Calendar.MONTH, +addMonth);

    cal.add(Calendar.DATE, +addDate);

    cal.add(Calendar.HOUR, +addHour);

    cal.add(Calendar.MINUTE, +addMinute);

    cal.add(Calendar.SECOND, +addSecond);


    SimpleDateFormat sdf2 = new SimpleDateFormat(format);

    String toDate = sdf2.format(cal.getTime());


    return toDate;

  }


  1년 후

  String addDate(format, "yyyy-MM-dd HH:mm:ss", 1, 0, 0, 0, 0, 0);

  10분 후

  String addDate(format, "yyyy-MM-dd HH:mm:ss", 0, 0, 0, 0, 10, 0);

FLAG_CANCEL_CURRENT : 이전에 생성한 PendingIntent 는 취소하고 새롭게 만든다.

FLAG_NO_CREATE : 생성된 PendingIntent 를 반환한다. 재사용 가능하다.

FLAG_ONE_SHOT : 이 flag 로 생성한 PendingIntent 는 일회용이다.

FLAG_UPDATE_CURRENT : 이미 생성된 PendingIntent 가 존재하면 해당 Intent 의 내용을 변경한다.


출처: http://mission12.tistory.com/89 [제자와 나눔]

http://www.dpriver.com/pp/sqlformat.htm

'기타' 카테고리의 다른 글

material develop android site  (0) 2021.07.28
유니코드 변환  (0) 2020.08.05
codebeautify  (0) 2017.12.02
맥 터미널 개발환경 구축하기  (0) 2017.12.02
나인패치 이미지 사이트  (0) 2017.12.02

<TextView
android:id="@+id/tvContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true" />

빨간색 부분 옵션을 추가하면됨

'android' 카테고리의 다른 글

VectorDrawable를 Bitmap로 변환  (0) 2018.03.07
pendingIntent Flag 옵션  (1) 2018.02.02
비트맵 파일로 떨어트리기  (0) 2017.12.14
웹뷰 바로 전의 URL 가져오기  (0) 2017.12.12
코드로 원 그리기  (0) 2017.12.11

+ Recent posts