我想在它上面显示带有静态小标签的微调器,它是如何可以看到一个流行的应用程序想要显示相同的.
这是我的图像,红色标记的是旋转器,上面有灰色文本,不会改变
我不想显示android:prompt哪个显示内部微调器中的默认文本想要在同一控件中的微调器上方精确显示

为此,您将必须创建自定义微调器:
微调器的布局根据您的需要命名为custom_spinner:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tVStaticSmallLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="static text"
android:textColor="#777777"
android:textSize="22px" />
<TextView
android:id="@+id/tVMainText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tVStaticSmallLabel"
android:layout_marginTop="5dip"
android:text="your changing text" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
in activity将此布局提供给微调器:
Spinner mySpinner = (Spinner) findViewById(R.id.yourSpinner);
mySpinner.setAdapter(new MyAdapter(this, R.layout.custom_spinner,
spinnerValues));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14624 次 |
| 最近记录: |