1
即时通讯使用spinner
我想知道你怎么能从spinner
item
出现在image button
图像使用字符串作为价值。更改从微调imagebutton
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_up);
spinnerListener();
St = (Spinner) findViewById(R.id.Namess);
imageButton01 = (ImageButton) findViewById(R.id.ImageButton1);
}
private void spinnerListener() {
ArrayList<Name> players = List_content.ENTRY_LIST_PLAYERS;
final ArrayAdapter<String> adapter=new ArrayAdapter<String>(Line_up.this, android.R.layout.simple_spinner_item);
{for (Name p : players){adapter.add(p.f_name);}};
playerss.setAdapter(adapter);
playerss.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> av, View v,
int position, long itemId) {
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// TODO Auto-generated method stub
}
});
}
public void goalkeeper(View v){
st.performClick();
}
你应该让你的问题更加清楚。也许给我一个例子。 您通常可以使用setDrawableResourceId()方法更改ImageButton图像。 – Behnam 2014-10-29 12:00:54
好,当我点击一个imageButton我想要微调打开,当我从微调选项中选择一个项目我想要图像按钮我按它来改变它的图像我在微调选择的图像 – Kalle 2014-10-29 12:11:52
好吧,我会告诉你什么做。 – Behnam 2014-10-29 12:26:12