开发者

Can I show up the textbox editor on an image icon in Android?

开发者 https://www.devze.com 2023-02-08 22:48 出处:网络
all, We know on Andorid, for a EditText, by default, whenever the EditText is clicked, the soft keyboard pops up to let you enter text. When you click DONE, it closes out and put the text directly to

all, We know on Andorid, for a EditText, by default, whenever the EditText is clicked, the soft keyboard pops up to let you enter text. When you click DONE, it closes out and put the text directly to the EditText. Now, what I am trying to do is, instead of an EditText, I have an ImageView which is to let user enter some comment.(So the ImageView actually is an comment icon). I wish whenever th开发者_运维技巧e icon is clicked, it pops up the text editor with user previous entered text, again once the DONE is hit, it closes out and I can save whatever text there back to a string member of the Activity. Is that possible? So far, all I've seen about InputMethodManager is on EditText control, If it is too complicated, I probably just put an EditText into a sperate Activity.

Thanks.


There are many solutions: One is to use custom dialog: http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

Second one is to use a transparent activity on top of that one.

Then you could use FrameLayout and insert another view in an exact position...

I think you should try the frist or second one. Every ImageView can be easily converted into a button by adding onClick event to it.

0

精彩评论

暂无评论...
验证码 换一张
取 消