我有这个微调器,想知道如何在其周围放置边框
Spinner dropdown = (Spinner)findViewById(R.id.spinnerUpdateContactMethod);
String[] items = new String[]{"1", "2", "three"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, items);
dropdown.setPrompt("Please select ");
dropdown.setAdapter(adapter);
提示实际上并没有出现在屏幕上。请有人帮我解决这个问题。
最佳答案
对于自定义边框,您可以在 drawable 文件夹中创建一个 xml 文件
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white_overlay_8x" />
<corners android:radius="6dip" />
<stroke
android:color="@color/white"
android:width="@dimen/dot" />
</shape>
并设置
android:background=@drawable/file;
在你的微调器中( Activity 的 xml 文件)
关于android - Spinner - 如何在下拉列表周围设置边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29387575/