动态计算一个链接到一系列按钮的TextView
Dynamic calculation of a TextView that is linked to a seris of buttons
我试图在我正在构建的应用程序上创建此流。我有一点麻烦得到TextView是友好的任何类型的公式/条件。任何建议我如何能得到TextView通过我的文本观察者动态输出的结果?提前感谢!
文本视图 //------------------DISPLAY-----------------''
netsale = (TextView)findViewById(R.id.netsale_input);
//--------------WAIT ASSISTANT--------------''
waMain = (TextView)findViewById(R.id.txt_wa_main);
waSplit = (TextView)findViewById(R.id.txt_wa_split);
清晰的按钮
public void clr_Clicked(View sender){
netsale.setText("0");
isempty=true;
}
数字小键盘
static boolean isempty=true;
public void num_Clicked(View sender){
Button bt=(Button)sender;
if(netsale.getText().length()>5)return;
if(isempty)
{
if(bt.getText().toString().equals("0"))return;
netsale.setText(bt.getText());
isempty=false;
}
else
{
netsale.append(bt.getText());
}
}
文本观察家
private TextWatcher filterTextWatcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
}
当你点击一个按钮时,比如"7",你应该通过使用setText(CharSequence);
所以一开始如果你的TextView是空白的("),当你点击7,它应该导致你的TextView显示"7"
相关文章:
- 创建一个类似链接的按钮,并通过Javascript函数打开一个新的弹出窗口
- 正在添加'X'按钮,在文本字段旁边使用javascript
- 多个单选按钮组相互干扰
- JavaScript下拉菜单-点击按钮并根据所选值重定向到url
- Javascript按钮下拉列表
- jquery试图按名称获取按钮位置
- 漂亮照片图片库中的Facebook赞按钮
- 扩展移相器按钮类不工作
- 通过单击表单中的按钮,在代码生成中使用javascript生成字母数字代码
- 单击按钮以等待单击按钮
- 剑道UI内联编辑:如何在点击其他按钮时隐藏按钮
- 单击按钮后如何逐个调用分区,上一个分区将隐藏
- 如何从querySelectorAll中获取按钮类型
- 如何在输入字段中的按钮的帮助下打开日历,该字段的类型为“=”;日期”;
- 按下按钮时保存cookie
- 是否可以禁用jquery中的单个单选按钮
- 使用数组来检查一系列 JavaScript 按钮
- 如何将一系列javascript (jQuery)按钮转换为click "进入一个循环
- 动态计算一个链接到一系列按钮的TextView
- 使用一个按钮在一系列照片中进行洗牌