TextView with ScrollView: If TextView is set to read-only TAB and ENTER keys are eaten
See original GitHub issueThis can be reproduced in the Wizard Scenario by setting helpTextView.CanFocus = false
in WizardStep()
.
Not sure if this is a bug in TextView
or ScrollView
, or if there is a different way of enabling scrolling on TextView
that works around this.
What I want is a read-only TextView that
a) Doesn’t take focus b) Can be scrolled with either mouse or keyboard
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top Results From Across the Web
Trying to display scrollable text in a fixed-sized container
I've tried using a read-only, multi-line EditText instead of the TextView and removing the ScrollView, but I couldn't make the EditText ...
Read more >TextView | Android Developers
android :digits, If set, specifies that this TextView has a numeric input method and ... focus instead of inserting a newline when you...
Read more >How to Make TextView Scrollable in Android?
Follow the below steps once the IDE is ready. TextView Can Be Made Scrollable by Two Methods: 1. By using ScrollView: With the...
Read more >ScrollView in Android
Defines which scrollbars should be displayed on scrolling or not. From ViewGroup. Attributes. Description. android:addStatesFromChildren, Sets ...
Read more >Swiftui get size of text. Apple does provide a custom font ...
import SwiftUI struct ContentView: View { var body: some View { GeometryReader {geometry in VStack { Text("Sizes") . blue with TextView in your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s the big idea:
A read-only TextView with a ScrollBarView is useful for displaying long text. When it is read only the user should be able to tab into and out of it. There is no world where it should eat tab presses when it is focused (and read-only).
Right now when
ReadOnly == true
the developer has to explicitly setAllowTabs = false
for the control to work as expected.The workaround is to set
AllowTabs = false
.I assert this is a bug, and if
ReadOnly == true
the control should ACT as thoughAllowTabs == false
. I do NOT think the fix is to automatically setAllowTabs
whenReadOnly
changes.This is what I have done.
helpTextView.ReadOnly = true
. The problem is, when you tab into thehelpTextView
you can’t tab out.But… I just discovered setting
helpTextView.AllowTab = false
addresses the issue.In other words, the REAL bug here is when
TextView.ReadOnly == true
the view should IGNORE tabs (as thoughAllowTab = true
).Note that when
AllowReturn
is set to false, something else is goofy, but that’s another bug which I’ll file a separate issue on.