0
활동에서 두 개의 텍스트보기가 있습니다. 상황에 맞는 메뉴에서 텍스트보기 중 하나의 텍스트 크기를 변경할 수있는 옵션이 있습니다. 나는 이런 식으로 뭔가를 시도 ..컨텍스트 메뉴에서 동적으로 변경되는 textSize가있는 Android AlertDialog
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()){
case R.id.menutextSize:
final CharSequence[] items = {"Normal","Large","Larger"};
AlertDialog.Builder builder = new
AlertDialog.Builder(this);
builder.setTitle("Select TextSize");
builder.setSingleChoiceItems(items, -1,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item],
Toast.LENGTH_SHORT).show();
}
});
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
int textSize = (int)mBodyText.getTextSize();
if (items[whichButton] == "Normal")
{
mTextv.setTextSize(12);
}
if (items[whichButton] == "Large")
{
mTextv.setTextSize(14);
}
if (items[whichButton] == "Larger")
{
mTextv.setTextSize(16);
}
}
});
builder.setNegativeButton("cancel", null);
builder.show();
return true;
}
t을 나는 님에게 메일 "가까운 강제"표시되어있는 라디오 버튼에 clciking하고 때. 이 문제를 어떻게 해결할 수 있습니까? 감사합니다 ..