0

我已经使用简单的代码来显示自动完成文本视图,但为什么文本对文本视图和下拉列表是透明的。我没有得到原因。请检查并告诉我原因。

爪哇代码

public class SendEmailScreenActivity extends Activity{

 /** Called when the activity is first created. */
AutoCompleteTextView autoText;



String president[]=  {"manmohan","Bush","clinton","arafat","vajpayee","brown","apple1","apple2","apple3","apple4"};
      @Override
      protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
        //Remove title bar
        this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
        setContentView(R.layout.activity_sendemail_screen);
        autoText = (AutoCompleteTextView)findViewById(R.id.AutoCompleteTextView_email_to);
        ArrayAdapter<String> adapter =  new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line,president);
        autoText.setThreshold(2);
        autoText.setAdapter(adapter);

    }

.xml

    <TableLayout
       android:id="@+id/tableLayout_personalinfo_memsa"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:layout_margin="5sp"
       android:padding="10sp"
       android:shrinkColumns="*">

    <TableRow
           android:id="@+id/tablerow_email_to"
           android:layout_width="fill_parent"
           android:layout_height="wrap_content">

       <AutoCompleteTextView
           android:id="@+id/AutoCompleteTextView_email_to"
           android:layout_width="0sp"
           android:layout_height="fill_parent"
           android:layout_weight=".7"
           android:padding="10sp"
           android:imeOptions="actionDone"
           android:dropDownSelector="@drawable/selected_state"
           android:background="@drawable/subscription_textarea_gray"
           android:hint="@string/hint_sms_to"/>

       <Button 
           android:id="@+id/button_send_email"
           android:layout_width="0sp"
           android:layout_height="fill_parent"
           android:layout_weight=".3"
           android:contentDescription="@string/string_test"
           android:text="@string/string_email_send"/>
      </TableRow>
        </TableLayout>
4

0 回答 0