TextField not shown on iOS
See original GitHub issueHi,
I am trying to use MKTextField on iOS and it is not displayed at all in the simulator. It is working on Android.
Version: RN: 0.27.2 RNMK: 0.3.2 iOS: 9.3
This is the expected result (on Android simulator):
This is how it looks like on iOS simulator:
They grey area is the place where the two MKTextField components are supposed to be.
Here is the JS code snippet:
import React from 'react';
import BaseReactComponent from '../common/BaseReactComponent';
import { View, StyleSheet } from 'react-native';
import { MKTextField, MKColor } from 'react-native-material-kit';
import PrimaryRaisedButton from '../common/buttons/PrimaryRaisedButton';
import {
TEXTFIELD_WITH_FLOATING_LABEL,
COMMON_STYLES
} from '../../styles/styles';
export default class LoginForm extends BaseReactComponent {
constructor () {
super();
this._bindClassMethods('_setInitialState', '_handleLogin');
this._setInitialState();
}
_setInitialState () {
this.state = {
username: '',
password: ''
};
}
render () {
return (
<View style={ [loginFormStyles.loginFormContainer, COMMON_STYLES.MARGIN_TOP_LG] }>
<MKTextField
style={ [TEXTFIELD_WITH_FLOATING_LABEL] }
keyboardType="email-address"
floatingLabelEnabled={ true }
highlightColor={ MKColor.Blue }
placeholder="Email Address" />
<MKTextField
style={ TEXTFIELD_WITH_FLOATING_LABEL }
password={ true }
floatingLabelEnabled={ true }
highlightColor={ MKColor.Blue }
placeholder="Password" />
<PrimaryRaisedButton
text='LOGIN'
onPress={ this._handleLogin } />
</View>
);
}
}
const loginFormStyles = StyleSheet.create({
loginFormContainer: {
alignItems: 'center'
}
});
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top Results From Across the Web
How to solve TextField text Not displaying in IOS Version 13.2 ...
In iOS 13 Dark mode Your Text color will not be visible. If you didn't set it. If you assign System colors dark...
Read more >Text Fields don't appear in stack view? - Apple Developer
Text Fields don't appear in stack view? ... I am using Xcode 11 for a macOS app. When I add a text field(s)...
Read more >text field not receiving input via iPhone simulator
Basically, I just added code to hide the "receivedElement" and show my new "loginElement". It displays just fine, but it won't let me...
Read more >TextField.text=number 0 does not shown in iOS. #9846 - GitHub
Since number may be assigned to TextField.text (For example, ListView's item has number 0 field), it is desirable to match Android. Beta Was...
Read more >How to read text from a TextField - Hacking with Swift
There are two important provisos when working with text fields. First, they don't have a border by default, so you probably won't see...
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 Free
Top 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
I was able to tackle that by setting the height on textInputStyle as well.
i tried all the above , nothing worked