Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Android Button is no improvement over TouchableElement #91

Open
ssomnoremac opened this issue Jan 26, 2016 · 2 comments
Open

Android Button is no improvement over TouchableElement #91

ssomnoremac opened this issue Jan 26, 2016 · 2 comments
Labels

Comments

@ssomnoremac
Copy link

Is this how a button is supposed to look on Android? Then -> why?

c94db75a-2c30-4441-9939-0bec54b05637

var MK = require('react-native-material-kit');
var { 
  MKButton,
  MKColor,
} = MK;

      <MKButton
        backgroundColor={MKColor.Teal}
        onPress={() => {this.readBook(book);}} >
        <Text pointerEvents="none"
              style={{color: 'white', fontWeight: 'bold',}}>
          READ
        </Text>
      </MKButton>
@Taakn
Copy link

Taakn commented Jan 30, 2016

@ssomnoremac style seems to be overriding. I use it like this:

style={[MKButton.accentColoredButton().style, styles.button]}

wherestyles.button is your style.

@alexprice1
Copy link
Collaborator

@ssomnoremac did @Taakn's solution work for you?

@alexprice1 alexprice1 added the bug label May 31, 2016
@sopent
Copy link

sopent commented Jun 11, 2016

  1. No, it is not a full solution. Lost "padding" and some other stuff.
    More nice solution it is to use {...MKButton.coloredButton().toProps()}
  2. Shadows not working on emulator (for me), but work good on real device.
  3. You can use Builder (new MKButton.Builder()) instead of jsx.
  4. It is not a bug in material kit, so this issue should be closed.

Full button can look like this

             <MKButton
                {...MKButton.coloredButton().toProps()}
                backgroundColor={MKColor.Teal}
                onPress={() => {this.readBook(book);}} >
                <Text pointerEvents="none"
                      style={{color: 'white', fontWeight: 'bold',}}>
                  READ (toProps)
                </Text>
             </MKButton>   

screenshot_2016-06-11-15-36-28

Many examples can be found here - #3

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants