Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Change TextInput's icon size #10

Closed
rafaelcorreiapoli opened this issue Jun 29, 2017 · 2 comments
Closed

Change TextInput's icon size #10

rafaelcorreiapoli opened this issue Jun 29, 2017 · 2 comments
Assignees

Comments

@rafaelcorreiapoli
Copy link

rafaelcorreiapoli commented Jun 29, 2017

The following code does not change the icon's size

import {RkTextInput} from 'react-native-ui-kitten';
import Icon from 'react-native-vector-icons/EvilIcons'
    <RkTextInput
      placeholder='Login'
      label={<Icon name="user" size={80}/>}
      rkType="rounded"
    />

It always appear as small icon

@malashkevich malashkevich self-assigned this Jun 29, 2017
@malashkevich
Copy link
Member

malashkevich commented Jun 29, 2017

Hello @rafaelcorreiapoli.
This happens because RkTextInput has default styles for all internal components.
As label is also internal component - it has some default fontSize value.
In order to override it you can use inline styling:

<RkTextInput
  placeholder='Login'
  label={<Icon name="star"/>}
  labelStyle={{fontSize:80}}
  rkType="rounded"
/>

But if you need to maintain styles separately - it's good idea to create new rkType. There are some examples in documentation (https://akveo.github.io/react-native-ui-kitten/#/docs/ui-components/rktextinput)
But for exact this sample you can do following:

  1. At start of the app define new rkType:
RkTheme.setType('RkTextInput', 'bigLabel', {
  labelFontSize: 80
});
  1. Just use this rkType in your app:
<RkTextInput
  placeholder='Login'
  label={<Icon name="star"/>}
  rkType="rounded bigLabel"
/>

Hope it helps.

@rafaelcorreiapoli
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants