小编Dev*_*i M的帖子

如何从单击它的位置开始新活动

当我单击任何图像或文本时,活动应从单击的图像或文本的位置开始.我试过了

overridingTransition(R.anim.xyz,R.anim.z);
Run Code Online (Sandbox Code Playgroud)

但这是静态的.我想从图像位置开始活动,而不是从屏幕的左下角或角落开始

android android-animation

5
推荐指数
1
解决办法
1152
查看次数

如何在edittext中将光标设置在end

每当我触摸edittext时,光标应该在end.Even如果editText已经有一些文本,它不应该允许移动左奖

 editTextView.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent event) {

                    editTextView.onTouchEvent(event);

                    if(!textFocus) {
                        editTextView.setSelection(editTextView.getText().length());
                        textFocus = true;
                    }

                    return true;
                }
            });

            editTextView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public void onFocusChange(View v, boolean hasFocus) {
                    textFocus = false;
                }
            });
Run Code Online (Sandbox Code Playgroud)

android

4
推荐指数
2
解决办法
4556
查看次数

标签 统计

android ×2

android-animation ×1