2013-02-06 71 views
0

我在對話框片段的創建對話框方法中創建了一個警告對話框。我正在使用陣列適配器填充警報對話框。我的問題是警報對話框大小取決於適配器中的文本。我想要以默認大小修復警報對話框。請幫助。警報對話框的大小因列表視圖而異

回答

0
place the textview in scrollview with fixed height. 
they are two methods to do that 
1)by using the ScrollView 


<LinearLayout android:id="@+id/LinearLayout01" 
android:layout_width="fill_parent" android:layout_height="fill_parent" 
android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res /android"> 
<ScrollView android:layout_width="wrap_content" 
android:layout_height="wrap_content" android:layout_weight="1"> 
<TextView android:id="@+id/TextView01" android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
android:text="Venkata Reddy," 
</ScrollView> 
</LinearLayout> 

2方法

<TextView 
    android:text="Single-line text view that scrolls automatically if the text is too long to fit in the widget" 
    android:singleLine="true" 
    android:ellipsize="marquee" 
    android:marqueeRepeatLimit ="marquee_forever" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:scrollHorizontally="true" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"/> 

使用的方法中的任一項...