그냥 jlhonora MultistateToggle Library
getValue()를 사용하여 무엇보다도 구현하려고하는 것은 안드로이드 위젯을 쉽게
public class AddListingForm extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_listing_form);
final MultiStateToggleButton toggleButton= (MultiStateToggleButton)
this.findViewById(R.id.MSTB);
// With an array
CharSequence[] states= new CharSequence[]{"Lowercase","Uppercase",
"Both"};
toggleButton.setElements(states);
toggleButton.setOnValueChangedListener(new ToggleButton.OnValueChangedListener() {
@Override
public void onValueChanged(int position) {
property_type = states[position].toString();
}
});
int a=toggleButton.getValue();
// if User selected Lowercase then you will get value of a is 0
// Similarly for Uppercase a will be 1 and for Both a will be 2
}
}
멀티 상태 전환 선택한 어떤 사용자 식별 할 수 있도록 인덱스 번호를 반환하는 방법이 아니다이다 . 라이브러리를 사용해야하며 해당 라이브러리의 문서 또는 코드를 조사해야합니다. – lionscribe
@lionscribe 도움의 손길에 감사드립니다. 이제 라이브러리의 코드를 살펴 보겠습니다. –