question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not showing on iOS, works on Android.

See original GitHub issue

I’m wondering if there’s anything extra that needs to be done for this component to work on iOS. The picker works fine on Android, but the same code does not display the picker on iOS. Here’s my render method:


render() {
    
    const datePickerText = this.state.valuePicked ? getSentDateString(moment(this.state.date).unix()) : "Not picked";

    const removeValueButton = this.state.valuePicked ? this.getRemoveValueButton() : null;
    
      return (
        <View style={{ flex: 1, alignItems: 'center', marginBottom: 20, marginTop: 2 }}>
          <Button 
          block
          style={{marginLeft:20, marginRight:20, marginTop: 10}}
					onPress={() => this.show(true)}
					>
            <Icon type="FontAwesome5" name='calendar-alt' />
						<Text>{datePickerText}</Text>
					</Button>
          {removeValueButton}
          { this.state.show && <DateTimePicker value={this.state.date}
                    mode={this.state.mode}
                    is24Hour={true}
                    display="default"
                    onChange={this.dateChanged} />
        }
        </View>
      );
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

39reactions
clark-choicommented, Dec 27, 2019

In this ios case:

  1. apply style
<DateTimePicker 
                  style={{width:'100%'}}
                   value={this.state.date}
                    mode={this.state.mode}
                    is24Hour={true}
                    display="default"
                    onChange={this.dateChanged} />
  1. include in View
<View>
      <DateTimePicker 
                   value={this.state.date}
                    mode={this.state.mode}
                    is24Hour={true}
                    display="default"
                    onChange={this.dateChanged} />
</View>

I think difference between ios and android to operate datetimepicker system

21reactions
habibmirandacommented, Mar 11, 2020

You can also add the following to your info.plist file: <key>UIUserInterfaceStyle</key> <string>Light</string>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Move from Android to iPhone, iPad, or iPod touch
A new iPhone showing the Apps & Data screen, where you choose how you want. Open the Move to iOS app. On your...
Read more >
What to do when Move to iOS app isn't working? - CopyTrans
Move to iOS app isn't working? The reasons for it may vary. We'll help you fix this issue and even look through the...
Read more >
[2022] What To Do When Move To iOS Is Not Working?
The reasons why Move to iOS is not working include: 1. Unstable Wi-Fi Connection: File transfer only works if both your iPhone and...
Read more >
How to resolve Move to iOS not working - Pocket-lint
iMobie How to resolve Move to iOS not working photo 2. Launch AnyTrans and connect your Android and iPhone via USB to your...
Read more >
Top 7 Ways to Fix iPhone Hotspot Not Showing Up on Android
Is your iPhone hotspot not showing up on Android? This is a common issue that can get rather frustrating. Here are some simple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found