我有一個微調。我從數據庫中檢索了SPINNER中的內容並將其綁定到Spinner。 但我的問題是Spinner窗口彈出的背景顏色是白色,內容的字體顏色也是白色。 所以我不能查看除了選定的窗口中的內容。微調控制器數據內容不可見
如何設置微調器的字體顏色?
以下是活動代碼:
我有一個微調。我將SPINNER中的內容從數組綁定到Spinner。
String bloodgroups[]={
"A +ve" "B +ve"
};
Spinner spinner=(Spinner)findViewById(R.id.spin);
ArrayAdapter<String> adapter=new ArrayAdapter<String> this,android.R.layout.simple_dropdown_item_1line,bloodgroups);
spinner.setAdapter(adapter);
但我的問題是微調窗口彈出的背景色爲白色,還字體顏色爲內容也是白色的。 所以我不能查看除了選定的窗口中的內容。
如何設置微調器的字體顏色?
下面是附文件:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/tc"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:freezesText="false"
android:text="Enter Name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:typeface="monospace" />
<EditText
android:id="@+id/txtname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Date of Birth"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/txtdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="date" />
<Button
android:id="@+id/btnseldate"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Date" />
</TableRow>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Blood Group"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/txtadd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPostalAddress" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter ContactNo. "
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/txtno"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="phone" />
<Button
android:id="@+id/btnadd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Submit Details" />
<Button
android:id="@+id/btndisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Show Details" />
</LinearLayout>
</ScrollView>
下面是附文件:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/tc"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:freezesText="false"
android:text="Enter Name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:typeface="monospace" />
<EditText
android:id="@+id/txtname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Date of Birth"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/txtdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="date" />
<Button
android:id="@+id/btnseldate"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Date" />
</TableRow>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Blood Group"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/txtadd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPostalAddress" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter ContactNo. "
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/txtno"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="phone" />
<Button
android:id="@+id/btnadd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Submit Details" />
<Button
android:id="@+id/btndisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Show Details" />
</LinearLayout>
</ScrollView>
向我們展示您的X ML代碼? – Praveenkumar
我已添加內容。 請檢討它。 –
Rushabh
您是否嘗試過用戶:Ram Kiran的回答? – Praveenkumar