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.

Setting containerStyle to an object or StyleSheet that doesn't have padding property results in an error

See original GitHub issue

This code results in an error:

<SwitchToggle
  containerStyle={{ width: 48, height: 16, borderRadius: 8 }}
  switchOn={true}
  onPress={() => {}}
/>

Error message: Exception thrown while executing UI block: -[NSNull floatValue]: unrecognized selector sent to instance 0x110525f28

While this code works fine:

<SwitchToggle
  containerStyle={{ 
    width: 48, 
    height: 16, 
    borderRadius: 8, 
    padding: 0, // < ------------ Added
  }} 
  switchOn={true}
  onPress={() => {}}
/>

(thanks for the lib!)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
hyochancommented, Nov 24, 2019

Hi. react-native-switch-toggle has been deprecated for a while and is migrated to react-hook in @dooboo-ui/native-switch-toggle. Hope you guys to check this out.

0reactions
hyochancommented, May 3, 2021

Closes due to inactivity. Version 2 is released just now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting containerStyle to an object or StyleSheet that doesn't ...
This code results in an error: {}} /> Error message: Exception thrown while ... or StyleSheet that doesn't have padding property results in...
Read more >
How do I prevent the padding property from changing width or ...
Let's say I create another DIV named anotherdiv exactly the same as newdiv , and put it inside of newdiv but newdiv has...
Read more >
padding | CSS-Tricks
Padding values are set using lengths or percentages, and cannot accept negative values. The initial, or default, value for all padding ...
Read more >
object-fit - CSS: Cascading Style Sheets - MDN Web Docs
The object-fit CSS property sets how the content of a replaced element, such as an or , should be resized to fit its...
Read more >
CSS - Cascading Style Sheets, designing for the Web - W3C
A style sheet is a set of one or more rules that apply to an HTML document. ... A semicolon separates the declarations...
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