这是在下面的xml布局中定义的微调器。
<Spinner
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
我在活动类中使用微调器,如下所示
void spinner(){
spMem=(Spinner)findViewById(R.id.spinner);
adapterMem=new ArrayAdapter<String>(this,R.layout.spinner_layout,R.id.txt,listItemsMem);
spMem.setAdapter(adapterMem);
spMem.setOnItemSelectedListener(
new AdapterView.OnItemSelectedListener() {
........................
考虑到调用上述方法时,如何禁止它出现在用户视线中。
答案 0 :(得分:0)
每个视图都有setVisibility()
方法。您可以使用它将视图的外观设置为INVISIBLE
,GONE
和VISIBLE
。