2011-08-07 5 views
2

웹 사이트에서 데이터를 가져 와서 텍스트보기 안에 배치하여 setGravity (Gravity.CENTER)를 사용하여 가운데 놓을 수 있도록했습니다. 그러나 경고 대화 상자 안에 텍스트보기를 배치 할 때 내 메시지의 끝을보기 위해 더 이상 아래로 스크롤 할 수 없습니다. 누군가이 문제를 도와 줄 수 있습니까? 당신은이 같은 코드 변경 시도 할 수 있습니다 당신에게경고 대화 상자 내의 TextView가 아래로 스크롤되지 않습니다.

TextView msg1=new TextView(Welcome.this); 
    //Takes data from a website 
    msg1.setText(Html.fromHtml(getText("http://www.cellphonesolutions.net/welcome-en"))); 
    msg1.setGravity(Gravity.CENTER); 
    LinearLayout dialogLayout = new LinearLayout(Welcome.this); 

    dialogLayout.addView(msg1); 
    dialogLayout.setOrientation(LinearLayout.VERTICAL); 
    AlertDialog welcome = new AlertDialog.Builder(Welcome.this).create(); 
    welcome.setView(dialogLayout); 

    welcome.setButton("OK", new DialogInterface.OnClickListener() { 

     @Override 
     public void onClick(DialogInterface dialog, int which) { 
     //rest of the code.... 

답변

5

감사합니다,

dialogLayout.addView(msg1); 
    dialogLayout.setOrientation(LinearLayout.VERTICAL); 
    AlertDialog welcome = new AlertDialog.Builder(Welcome.this).create(); 
    ScrollView scrollPane = new ScrollView(this); 
    scrollPane.addView(dialogLayout); 
    welcome.setView(scrollPane); 
+0

완벽한 감사합니다 (내가 투표 할 것입니다하지만 난 15 렙에서 여전히 해요) – Sean

관련 문제