Ant-design-mobile: Styling Button's text in React Native

Created on 14 Sep 2017  ·  5Comments  ·  Source: ant-design/ant-design-mobile

It does look like the Button component takes a styles prop which you later use to apply the Text styles.

https://github.com/ant-design/ant-design-mobile/blob/c30d049c1a0ca7cd812cdd11d544fec75a10e4e7/components/button/index.native.tsx#L84

I can't find documentation on how to change the text color. I noticed I can switch between black and white by using the type='primary' prop, but I need other colors 😄

Any hints would be greatly appreciated.

Invalid

All 5 comments

Hello @silvestreh, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!

Thanks! For people who might get here through a Google search here's how I solved using @paranoidjk hints:

import ButtonStyle from 'antd-mobile/lib/button/style/index.native';

StyleSheet.create({
  ...ButtonStyle,

  defaultRawText: {
    color: 'red'
  }
});

Ref: #2461 #2025 #1856 #1851 #1174 #815 #698

@silvestreh how can i do?

Was this page helpful?
0 / 5 - 0 ratings