1
我從https://github.com/makeramen/android-segmentedradiobutton進口這種方法。 如何顯示視圖(可以是列表視圖,ImageView的或其他)被點擊每個按鈕時。
這裏是代碼..
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
// TODO Auto-generated method stub
if (group == segmentText) {
if (checkedId == R.id.button_one) {
Toast.makeText(getApplicationContext(), "Featured",
Toast.LENGTH_SHORT).show();
} else if (checkedId == R.id.button_two) {
Toast.makeText(getApplicationContext(), "NearBy",
Toast.LENGTH_SHORT).show();
} else if (checkedId == R.id.button_three) {
Toast.makeText(getApplicationContext(), "Whatsup",
Toast.LENGTH_SHORT).show();
}
}
}
嘗試設置每個佈局的知名度不見了/可見光 – Cjames 2013-03-04 07:45:29