我有一个textview与一些文本。Textview有触摸事件,所以用户可以旋转,缩放和翻译文本。有人能帮我吗?
是首先转换textview在imageview后,你可以处理文本中的多点触控
解决方案:
TextView usertext = new TextView(this);
usertext.setText("Hi Hello");
usertext.setTextSize(22);
usertext.setBackgroundColor(Color.TRANSPARENT);
Bitmap testB;
testB = Bitmap.createBitmap(TextLayout.getWidth(), TextLayout.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(testB);
usertext.layout(0, 0, 80, 100);
usertext.draw(c);
// create imageview in layout file and declare here
Imageview iv = (Imageview) findviewByid(your imageview id)
iv.setImageBitmap(testB);
iv.setOnTouchListener(this);
享受…