首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

安卓按键设立TextView字体的大小

2013-10-18 
安卓按键设置TextView字体的大小Activity里面的函数为button1 (Button)layout.findViewById(R.id.button

安卓按键设置TextView字体的大小

安卓按键设立TextView字体的大小

Activity里面的函数为

button1 = (Button)layout.findViewById(R.id.button1);
   button2 = (Button)layout.findViewById(R.id.button2);
   text = (TextView)layout.findViewById(R.id.textView2);
   text1 = (TextView)layout.findViewById(R.id.textView3);
   text.setText(String.valueOf(size));
   
   button1.setOnClickListener(new OnClickListener() {
    
    @Override
    public void onClick(View arg0) {
     // TODO 自动生成的方法存根
     size++;
     text.setText(String.valueOf(size));
     text1.setTextSize(size);
    }
   });
   
   button2.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View arg0) {
       // TODO 自动生成的方法存根
       size--;
       text.setText(String.valueOf(size));
       text1.setTextSize(size);
      }
     });

 

 

热点排行
Bad Request.