就像我說的。我不知道如何將我的spinner
中的所有內容都設置爲白色。 問題是這樣的圖像 當我將所有東西都改爲白色時,我的微調器仍然是黑色的,爲什麼>
就像你看,我有白色和黑色總是與黑色的背景這個按鈕是不好可見英寸
下面是一些代碼:
<Spinner
android:id="@+id/spinner_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:text="50$"
android:textColor="@color/white"
android:textSize="20sp" />
什麼是錯的傢伙?
在這裏,我confgure微調
private void configureSpinnerDataAndLogic() {
String[] arraySpinner = new String[]{
"50", "100", "150", "200", "250", "300", "400", "500"};
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(),
android.R.layout.simple_list_item_1, arraySpinner);
spinnerData.setAdapter(adapter);
spinnerData.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
((TextView) parent.getChildAt(0)).setTextColor(Color.WHITE);
String text = spinnerData.getSelectedItem().toString();
int temp = Integer.parseInt(text);
text_profit.setText((temp * 2) + " $ " + "100%");
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
編輯:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="20dp"
android:gravity="right"
android:layout_centerVertical="true"
android:height="20dp">
<rotate
android:fromDegrees="45"
android:pivotX="135%"
android:pivotY="15%"
android:toDegrees="45">
<shape android:shape="rectangle">
<solid
android:color="@color/white" />
</shape>
</rotate>
</item>
</layer-list>
你必須設置微調 – Ibrahim
與此微調yahahha這麼多工作一個自定義適配器:d – Genehme
我修改了主哨 – Genehme