我试图减少微调器的字体大小,并创建了一个名为spinner_item的XML文件。
spinner_item.xml:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="#800080" />
加载微调器的方法:
private void loadCustomServiceSpinner(String workRequestType) {
CustomServiceDBQueries csQueries = new CustomServiceDBQueries();
customServices = csQueries.selectCustomService(workRequestType);
String[] strCustomService = new String[customServices.size() + 1];
strCustomService[0] = "";
int i = 1;
for (CustomService cs : customServices) {
strCustomService[i] = cs.getCustomServiceName();
i++;
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
R.layout.spinner_item, strCustomService);
adapter.setDropDownViewResource(R.layout.spinner_drop_default);
Spinner SpnCustomService = (Spinner) findViewById(R.id.SpnCustomService);
SpnCustomService.setAdapter(adapter);
}
我没有看到任何变化,源可能是20或50 SP SP,不会改变任何东西。有人能帮助我吗?