The bounty expires in 4 days. Answers to this question are eligible for a +50 reputation bounty.
Allen Y wants to draw more attention to this question.
My app's main screen is relatively simple - a header, a main body that's primarily a text input, and a footer. It's set up like this (I'm simplifying the code to just call out the major structural items):
SafeAreaProvider
SafeAreaView // flex: 1
KeyboardAvoidingView // behavior="height", flex: 1, children also have flex: 1
Header // fixed height, no flexGrow
Swipeable // This lets the user swipe the input left or right; set to flexGrow: 1 and children have style flexGrow: 1
View
TextInput // multiline
Footer // fixed height, no flexGrow
The bug is that this combination of elements isn't working as I'd expect. First, when the screen first loads, it looks like this, with an empty gap between the footer and the keyboard:
Moving to a different screen then back results in the keyboard showing, but the footer getting pushed all the way to the bottom of the screen, ie into the part where SafeArea is supposed to prevent it from going and hidden by the keyboard:
Why is that white gap showing on screen load, and why does the footer go into the SafeArea when the keyboard is dismissed?
Addendum: frustratingly, this bug does not repro when running the app locally on Expo Go - the Footer is flush against the top of the keyboard.
Addendum 2: A mystifying thing about this bug is that it doesn't seem to be consistent. For example, the observation from my original post about going to another screen and back resulting in the footer being too far down into the safearea exclusion part does not happen consistently. Now when I'm loading the app (I haven't changed anything), going to another screen and back results in the Footer being above the safearea exclusion zone as I'd expect.
I wonder if this inconsistency suggests it's some kind of race condition between different parts of the frontend?
can you add this prop in KeyboardAvoidingView
keyboardVerticalOffset={-80}
adjust with your requirements
Related
My application is using a com.vaadin.flow.component.applayout.AppLayout with a header and a drawer (a standard layout inspired by misc. example programs). The lower right content part is populated with VerticalLayouts that have a #Route(value="foobar", layout = MainLayout.class) annotation, so when clicking on one of the "anchors" in the drawer the corresponding view is added.
That works all nice except for one thing that annoys me:
One of my views has four Accordion components (2 containing a couple of labels and a TextArea each, one containing some textfields and a chart. The forth contains some text fields and a button).
When I unfold these accordions then typically when expanding the third or fourth there is suddenly a second vertical scrollbar appearing just inside the outer, normal scrollbar. Already two opened accordions are higher than what fits a typical browser window, but here the size and the scrollbar is adjusted correctly. Sometimes, but strange enough not always, the scrollbar also adjusts properly with three opened accordions. Sometimes already with the 3rd, but definitely always with the 4th accordion that second scrollbar appears. The combination of opened accordions does not seem to play a role, i.e. there is no accordion that ALWAYS triggers that scrollbar appearing.
I find this second scrollbar most irritating and annoying when navigating the page. Any idea what could cause this? And how to force a single scrollbar only?
BTW: I experimented with wrapping the entire content inside a Div but that didn't change anything - the second scrollbar still appears as described above.
It seems there's two main sections:
Let's call them emojiCollection and bottomBar. bottomBar seems simple enough, a UIStackView that's horizontal, that contains a back to main keyboard button, backspace, and a bunch of categories in the middle.
emojiCollection is trickier for me to understand, and my questions are:
1) how would one have "sections" of emojis, where there is a title at the top that remains in place until you get to the next section. Is this all just one UICollectionView?
2) How would you go about highlighting the section in bottomBar to identify which section you're in.
3) Seeing that it's horizontal and extends past the screen, would it be placed in a UIView that has some width proportional to the amount of rows, or would it automatically keep growing?
EDIT: To answer Losiowaty's question, this is how I would like to build it:
I have two column site current set up using wordpress but an having trouble figuring out how to fix the right side column so that it does not allow it to scroll over the right side on the iPad. On desktops the page behaves as it should, however on iOS the div is able to scroll over the nav bar. My problem is the right column needs to be able to scroll vertically, so if I give it a fixed position I loose that functionality. Here is the link http://www.adamheimer.com, thanks to anyone who can help me out!.
Not entirely certain about what you're after, but have you looked at overflow-y:scroll style? It allows you ensure an element is a certain height, and if the element exceeds that height, the user is able to scroll it.
The content on my screen is definitely able to fit into the given screen size, yet the app still shows scrollbars if the screen is shorter than a certain height.
This fiddle shows the issue, if you shrink the result pane to a certain height.
What I've tried:
Adding `overflow-y:hidden' to the body fixes this issue, but I want to be able to scroll in the y-direction if needed, just not when it's not needed.
How can I stop this scrolling when unnecessary?
The reason ended up being because of a rule in the jQueryMobile.css:
.ui-page, bla, bla{
min-height: 420px;
}
changing that to a smaller number that matches what I needed fixed the issue.
I've got an app where I allow the user to add events to a list. The method I use to do this is via a form that I show the user in a UIPopOver.
The form has the following components (in this order, top to bottom):
Event Description Label (UILabel)
Event Description (UITextField)
Event Details Label (UILabel)
Event Details (UITextView)
Event Time Label (UILabel)
Event Time (UIDatePicker)
Save Event (Custom Button)
Cancel (Custom Button)
I'd prefer not to show a screen shot since it's a sensitive app. :-)
So........
All is well when I first show the UIPopOver. Everything appears as I wish. The overall layout is about 650 pixels tall, which is just tall enough to take up pretty much the whole screen (vertically) when in landscape mode.
When the user tries to interact with the `UIDatePicker`, everything goes swimmingly (well).
When the user taps into the Event Description (`UITextField`) field, the keyboard appears and the `UIPopOver` shrinks so that basically the `UIDatePicker` and buttons are hidden. I consider this OK, since they re-appear when the keyboard is dismissed.
The problem I am having is when the user tries to interact with the `UITextView`:
When the view of the `UIPopOver` has its `backgroundColor` property set to `[UIColor whiteColor]`, the `UITextView` initially appears with a thin black border. I like this.
When the user taps in the `UITextView` to begin editing, the `UIPopOver` resizes to accommodate the keyboard and, during the transition, the black border "shrinks up" and disappears. This is in spite of my shocks and struts being set so that all dimensions/directions are fixed and it is "glued" to the top-left.
Following this, when the user dismisses the keyboard, the border sort of restores itself to its previous position, but it now adds a thick black border on the bottom that completely obscures the label placed between the `UITextView` and the `UIDatePicker`.
When I change the background of the view of the `UIPopOver` to "`ScrollView` Textured Background Color", the border "disappearing trick" is at least less noticeable, but the black border at the bottom (following keyboard dismissal) is still present.
Questions
Has anyone encountered something like this before?
Does anyone think it's just an IB error and that I need to re-build my XIB?
Anybody got any other ideas? Googling for this issue came up fairly empty for me. If you think of better terms and find something, please let me know (gently).
Boy, I'm a stupid stupid!!! It turns out I had forgotten that I placed the UITextView inside of a UIView (inset 1 pixel on all sides) and set the background of the UIView to be black so that I could get a border effect on the UITextView. Once I remembered that, setting the shocks/struts of THAT UIView turned out to be the solution.
Sorry for wasting your time!