본문 바로가기

전체

(70)
[ Android ] EditText 커서 색 변경, 포커스 제거 EditText 커서 색 변경 EditText 포커스 제거 => EditText를 감싸고 있는 레이아웃에 다음과 같이 추가 android:focusable="true" android:focusableInTouchMode="true"
[ Android ] EditText 엔터 처리 및 다양한 속성 알아보기 엔터 시 다음 입력으로 넘어감 editLoginId.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) { if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL || actionId == keyEvent.KEYCODE_ENTER || actionId == EditorInfo.IME_ACTION_GO) { editLoginPassword.requestFocus(); return true; } r..
[ Android ] AlertDialog 다이얼로그 확인 / 취소 AlertDialog.Builder builder = new AlertDialog.Builder(this); builder .setMessage("정말로 종료하시겠습니까?") .setPositiveButton("취소", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.cancel(); } }) .setNegativeButton("확인", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterfa..
[ Android ] 버튼 이미지(변경 + hover 효과) drawable 폴더에 xml 생성 ( reset_button_selector.xml ) *** 적용 ***
[ Android ] 커스텀 레이아웃 색 변경 drawable 폴더에 xml 생성 ( layout_button_selector.xml ) *** 적용 ***
[ Android ] Custom Button 커스텀 버튼 색 변경 - drawable 폴더에 xml 생성 ( round_button ) - stroke : 테두리 - solid : 배경색 - corners : 모서리 모양 //클릭한 경우 //클릭 안한 경우 *** 적용 ***
[ Android ] 손쉽게 Custom Toast 만들기 아래의 메소드를 정의하고 호출하면 사용할 수 있다. public void customToast(Context context, String msg) { TextView txtToastMsg = new TextView(context); txtToastMsg.setText(msg); txtToastMsg.setBackgroundResource(R.drawable.post_button); txtToastMsg.setWidth((int)( 150 * getResources().getDisplayMetrics().density)); //가로 txtToastMsg.setHeight((int)( 40 * getResources().getDisplayMetrics().density)); //세로 txtToastMsg.s..
[ Android ] Custom Progressbar 커스텀 프로그래스바 만들기 custom_progressbar.xml MainActivity.class @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) private void showProgress(final boolean show) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); } }

반응형