2012-03-08 32 views
0

時不顯示內TableLayout的頂部我有一個配置對話框的佈局在像這樣的XML:的Android滾動型在對話框旋轉

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/timerConfigurationDialog" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <TableLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:gravity="center" 
     android:scrollbars="vertical" > 

     ... 

    </TableLayout> 
</ScrollView> 

我使用下面的代碼膨脹它:

LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE); 
View layout = inflater.inflate(R.layout.timer_configuration_dialog, 
            (ViewGroup) findViewById(R.id.timerConfigurationDialog)); 
AlertDialog.Builder builder = new AlertDialog.Builder(this); 
builder.setView(layout) 
     .setTitle(R.string.configure) 
     ...; 

當我測試它在模擬器中有當屏幕是垂直的,因爲對話的所有組件都可見,但,當屏幕是水平的,第一行和第二的上半部分沒有問題行是不可見的(當然,它們遠遠不能達到滾動)。

我已經嘗試過不同組合的佈局,沒有成功...任何幫助將不勝感激!

由於提前,

勞爾

回答

1

由於沒有答案,我已經改變了彈出窗口的佈局。現在,我不在ScrollView中使用TableLayout ...而是在ScrollView中有一個LinearLayout,所以當用戶旋轉屏幕時,對話框沒有問題。