textselection

Is there any way to programatically select text in a TextView?

情到浓时终转凉″ 提交于 2019-12-23 10:58:30
问题 I have a TextView that I'm looking to allow the user to search in for a specific string. If the string is found, it should highlight. Using a background span is too slow and awkward, so I am trying to figure out if I can just have it select the string. I know with EditText this would be possible using setSelection() , but I don't want the user to be able to edit the text, while still being able to manually highlight text, which I can't seem to do manage with an EditText . I guess, then it's

Disabling text selection in DocumentViewer

限于喜欢 提交于 2019-12-22 06:10:13
问题 Simple question. How do you disable the text selection of DocumentViewer in WPF? This is the feature where an XPS document is displayed by the viewer and then text can be highlighted via mouse. The highlighted text can also be copied but I have already disabled this. I just don't know how to disable the highlighting. Thanks! 回答1: We have solved this by overriding the ControlTemplate of the ScrollViewer embedded in the DocumentViewer control. Insert the Style below in "Window.Resources":

Disabling text selection in DocumentViewer

一个人想着一个人 提交于 2019-12-22 06:10:12
问题 Simple question. How do you disable the text selection of DocumentViewer in WPF? This is the feature where an XPS document is displayed by the viewer and then text can be highlighted via mouse. The highlighted text can also be copied but I have already disabled this. I just don't know how to disable the highlighting. Thanks! 回答1: We have solved this by overriding the ControlTemplate of the ScrollViewer embedded in the DocumentViewer control. Insert the Style below in "Window.Resources":

Android Text Selection Listener

瘦欲@ 提交于 2019-12-18 12:32:35
问题 I'm trying to create a graceful, distraction-free text editor. One of the features I really would like to implement is a pop-up with simple text formatting commands, such as bold, italic, underline, font color, and font face. To give you an idea, here is a picture of the popup in iOS(Obviously, this is just the idea. I want to create a custom design for the popup): I have a few questions: 1) Is there such thing as a text selection listener, or some equivalent? 2) Will I need to override the

Android Text Selection Listener

若如初见. 提交于 2019-12-18 12:32:08
问题 I'm trying to create a graceful, distraction-free text editor. One of the features I really would like to implement is a pop-up with simple text formatting commands, such as bold, italic, underline, font color, and font face. To give you an idea, here is a picture of the popup in iOS(Obviously, this is just the idea. I want to create a custom design for the popup): I have a few questions: 1) Is there such thing as a text selection listener, or some equivalent? 2) Will I need to override the

Android 3.x ONLY WebView Text Selection + JavaScript

核能气质少年 提交于 2019-12-18 11:33:00
问题 Problem domain: Android WebView based ePub format reader -- We need text highlights which are accessible via JavaScript methods (ie turn em on, turn em off, save them email them, etc) Anyone in the know, please correct me if I'm wrong: During text selection on a WebView -- Basically we are handed a TextView overlay (WebTextView) which is IN NO WAY attached to the underlying html other than visually (nice job on lining it all up and making it seamless, btw), on which we perform the

IntelliJ Column Selection using Cursor Keys

∥☆過路亽.° 提交于 2019-12-18 10:19:33
问题 Is it possible to some how setup IntelliJ IDEA so that I can column select with the cursor keys similarly to how I might in Notepad++, Visual Studio, or FlashDevelop. For instance when I'm typing code I almost always do my navigation solely through use of the keyboard. In the IDEs mentioned previously I can quickly select blocks of code by holding Shift + Alt then tapping ↑ to extend my cursor across the lines above. I can then hold Shift + Alt + Ctrl and tap ← or → to quickly jump across

Why doesn't this MotionEvent simulation work?

强颜欢笑 提交于 2019-12-18 08:16:11
问题 In one of the views in an exercise app, am trying to perform text selection programmatically. I am able to (programmatically) enter "text selection mode", which is visually indicated by CursorControllers (AKA handles) on the top-left corner of the view. If I manually drag the right CursorController, then click it again (in the emulator), it works as expected (perfectly), showing a brief message: "Text copied to clipboard". But when I try to programmatically drag that right CursorController,

How to get coordinates (CGRect) for the selected text in UIWebView?

≯℡__Kan透↙ 提交于 2019-12-17 23:27:48
问题 I have simple UIWebView with loaded html. I want to show the PopoverView pointed to the selected text. I can get the menuFrame of the UIMenuController and use its rect, but the result isn't as accurate at the corners of the screen as I need. I can calculate the screen size and get menuFrame rect and then I can suppose where the selection may be found, but I want exactly know where is the selected text. Is it generally possible? 回答1: You can use the javascript function getBoundingClientRect()

How to disable cursor positioning and text selection in an EditText? (Android)

馋奶兔 提交于 2019-12-17 18:28:43
问题 I'm searching for a way to prevent the user from moving the cursor position anywhere. The cursor should always stay at the end of the current EditText value. In addition to that the user should not be able to select anything in the EditText. Do you have any idea how to realize that in Android using an EditText? To clarify: the user should be able to insert text, but only at the end. 回答1: I had the same problem. This ended up working for me: public class CustomEditText extends EditText {