File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
demo/src/screens/componentScreens Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export default class ButtonsScreen extends DemoScreen {
6565 return (
6666 < View useSafeArea >
6767 { ! ! snippet && < SnippetBlock snippet = { snippet } onClose = { ( ) => this . hideSnippet ( ) } /> }
68- < ScrollView >
68+ < ScrollView showsVerticalScrollIndicator = { false } >
6969 < View centerH >
7070 < Text style = { styles . title } > Buttons</ Text >
7171
Original file line number Diff line number Diff line change @@ -176,6 +176,21 @@ export default class Button extends PureBaseComponent {
176176 }
177177 }
178178
179+ componentDidMount ( ) {
180+ Constants . addDimensionsEventListener ( this . onOrientationChanged ) ;
181+ }
182+
183+ componentWillUnmount ( ) {
184+ Constants . removeDimensionsEventListener ( this . onOrientationChanged ) ;
185+ }
186+
187+ onOrientationChanged = ( ) => {
188+ if ( Constants . isTablet && this . props . fullWidth ) {
189+ // only to trigger re-render
190+ this . setState ( { isLandscape : Constants . isLandscape } ) ;
191+ }
192+ } ;
193+
179194 // This method will be called more than once in case of layout change!
180195 onLayout = event => {
181196 const height = event . nativeEvent . layout . height ;
You can’t perform that action at this time.
0 commit comments