直接上代码 layout代码: class代码: public void iv_1(View view){ textView1=(TextView)findViewById(R.id.textView1); num1=Integer.parseInt(textView1.getText().toString()); if(num1>1){ num1-=1; } textView1.setText(Integer.toString(num1)); } public void iv_2(View view){ textView1=(TextView)findViewById(R.id.textView1); num1=Integer.parseInt(textView1.getText().toString()); if(num1<999){ num1+=1; } textView1.setText(Integer.toString(num1)); } 效果图