안드로이드 개발 질문/답변
(글 수 45,052)
레이아웃에 스크롤 기능을 빼면
AlertDialog.Builder 에서도 잘 되는데....
아래처럼 스크롤을 구현하면...안되네요.
xxxx.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="분류"/>
.
.
.
</LinearLayout>
</ScrollView>
스크롤이 있는 View를 가지는 커스텀 다이얼로그가 있다고 하던데...
고수님의 답변 기다리겠습니다.
AlertDialog.Builder 에서도 잘 되는데....
아래처럼 스크롤을 구현하면...안되네요.
xxxx.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="분류"/>
.
.
.
</LinearLayout>
</ScrollView>
스크롤이 있는 View를 가지는 커스텀 다이얼로그가 있다고 하던데...
고수님의 답변 기다리겠습니다.
2010.10.13 10:52:21
자답입니다.
글 올리고 혹시나해서...
final LinearLayout linear = (LinearLayout)View.inflate(Pointcard_Type.this, R.layout.custom_db_add, null);
이 부분을 아래 처럼 고쳐 봤는데 됐습니다.
final ScrollView linear = (ScrollView)View.inflate(Pointcard_Type.this, R.layout.custom_db_add, null);
new AlertDialog.Builder(Pointcard_Type.this)
.setTitle("입력하세요")
.setView(linear)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
})
.setNegativeButton("취소", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
})
.show();
감사합니다.
글 올리고 혹시나해서...
final LinearLayout linear = (LinearLayout)View.inflate(Pointcard_Type.this, R.layout.custom_db_add, null);
이 부분을 아래 처럼 고쳐 봤는데 됐습니다.
final ScrollView linear = (ScrollView)View.inflate(Pointcard_Type.this, R.layout.custom_db_add, null);
new AlertDialog.Builder(Pointcard_Type.this)
.setTitle("입력하세요")
.setView(linear)
.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
})
.setNegativeButton("취소", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
})
.show();
감사합니다.



