안드로이드 개발 질문/답변
(글 수 45,052)
안녕하십니까...! 오늘도 고수님들 수고 많으십니다.
OnCreate에서 다음과 같이 동적으로 EditText를 생성하여 사용하는데요
아래와 같이 코딩해도 EditText가 2줄이 넘어가도 수직 스크롤바가 생기는 않는군요....
도움 부탁드립니다.... 2일째 ....ㅜㅜ
EditText et = new EditText(this);
et.setLayoutParams(new LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
et.setVerticalScrollBarEnabled(true);
et.setMinHeight(68);
et.setMaxLines(2);
LinearLayout root = (LinearLayout)findViewById(R.id.park);
root.addView(et);
main으로 사용하시는 레이아웃에
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent" >
/>
를 추가해주시면 돼요.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent" >
<LinearLayout ~
/>
/>
이런 식으로요.