我正在尝试在应用程序中放置put“%”结果。
问题是我正在使用它的Mask做到这一点很简单,所以当我使用它时,数字从1到999,并且“%”似乎也没有显示。
有人可以帮助我吗?
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
import com.github.rtoshiro.util.format.MaskFormatter;
import com.github.rtoshiro.util.format.SimpleMaskFormatter;
import com.github.rtoshiro.util.format.pattern.MaskPattern;
import com.github.rtoshiro.util.format.text.MaskTextWatcher;
public class ActivityForm extends AppCompatActivity {
private EditText percentual;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity_form);
percentual = (EditText) findViewById(R.id.percentual_Id);
SimpleMaskFormatter simpleMaskPercentual = new SimpleMaskFormatter( " NNN% " );
MaskTextWatcher maskPercentual = new MaskTextWatcher(percentual, simpleMaskPercentual);
percentual.addTextChangedListener( maskPercentual );
}
}