react native pit in Demensions

Problems encountered under the simple description: Demensions.get ( 'window') height, generally used to get the screen height. But millet mix3 above (other Android models may also have) Whether virtual physical bottom of the keyboard is displayed or not (at the bottom of the back button, home button), full-screen height is the height minus the value of the virtual physical keyboard height.

 

Such a problem arises, turn off the display when the virtual physical keyboard in the phone settings, then set the height Flatlist will not hold over until the bottom of the phone screen, the original position of the virtual physical keyboard will be a blank area is He said retained the position of the virtual physical keyboard, so that visually is very strange.

 

Solution 1: outermost view in viewport or flatList try to avoid hard-coded height, height can have a 100% no height or directly to distraction by the content automatically. tips: 100% set height, or the element itself relative positioning not have siblings

 

Solution 2: 

https://github.com/Sunhat/react-native-extra-dimensions-android  The plug-in supports access to accurate height, but need native support in NativeModules corresponding module, or will be error.

Guess you like

Origin www.cnblogs.com/hjj2ldq/p/11649529.html