Giter Site home page Giter Site logo

Comments (16)

talut avatar talut commented on July 25, 2024

Hi, buttonDeleteStyle only accept style object not a component.

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

I also tried this code but does not work.

buttonDeleteStyle={{fontSize: 16}}

from react-native-pin-view.

talut avatar talut commented on July 25, 2024

@hosseinpro buttonDeleteStyle is changing style of delete button not delete button text. So you can't use fontSize etc.

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

So, do you have an example of that?
For example, how can I hide the delete button permanently?

from react-native-pin-view.

talut avatar talut commented on July 25, 2024

So, do you have an example of that?
For example, how can I hide the delete button permanently?

There is no special props for changing delete button text style you can use keyboardViewTextStyle but this props changing all button text styles.

 keyboardViewTextStyle={{
            fontSize: 11,
          }}

There is no props for hiding the delete button. And I'm not adding new features 'cause I'm rewriting this package with modern practices.

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

Thank you for the quick response.
So, can I change the color of the delete button? Do you have an example?

from react-native-pin-view.

talut avatar talut commented on July 25, 2024

Thank you for the quick response.
So, can I change the color of the delete button? Do you have an example?

You can change text color of buttons with keyboardViewTextStyle also you can change deleteButton background color with buttonDeleteStyle

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

I tested this code but it does not work:

buttonDeleteStyle={{ backgroundColor: "Green" }}

What is the problem?

from react-native-pin-view.

talut avatar talut commented on July 25, 2024

buttonDeleteStyle={{ backgroundColor: "Green" }}

"Green" > "green"

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

buttonDeleteStyle={{ backgroundColor: "Green" }}

"Green" > "green"

same result. this is my code:

`<PinView

         onComplete={(pass, clear) => {
          clear();
          this.setState({ visible: false });
          this.state.onComplete(pass);
        }}
        pinLength={4}
        delayBeforeOnComplete={0}
        buttonBgColor={Colors.secondary}
        buttonTextColor={Colors.secondary}
        inputBgColor={Colors.primaryText}
        buttonDeleteStyle={{ backgroundColor: "green" }}

/>`

from react-native-pin-view.

talut avatar talut commented on July 25, 2024

Screen Shot 2020-01-15 at 17 34 56

import React, { Component } from "react"
import { View } from "react-native"
import PinView from "react-native-pin-view"

type Props = {}
export default class Test extends Component<Props> {
  constructor(props) {
    super(props)
    this.onComplete = this.onComplete.bind(this)
    this.state = {
      pin: "896745",
    }
  }
  onComplete(inputtedPin, clear) {
    if (val !== this.state.pin) {
      clear()
    } else {
      console.log("Pin is correct")
    }
  }
  onPress(inputtedPin, clear, pressed) {
    console.log("Pressed: " + pressed)
    console.log("inputtedPin: " + inputtedPin)
    // clear();
  }
  render() {
    return (
      <View
        style={{
          flex: 1,
          backgroundColor: "#f1f1f1",
          justifyContent: "center",
        }}>
        <PinView
          onPress={this.onPress}
          onComplete={this.onComplete}
          buttonDeleteStyle={{ backgroundColor: "green" }}
          pinLength={this.state.pin.length}
          // pinLength={6} // You can also use like that.
        />
      </View>
    )
  }
}

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

What version do you use? 2.4.1 or 2.5.0?

from react-native-pin-view.

talut avatar talut commented on July 25, 2024

"react-native-pin-view": "^2.5.0",

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

Solved. I removed the "react-native-pin-view" package and installed it again.

from react-native-pin-view.

talut avatar talut commented on July 25, 2024

So I'm closing the issue if is K?

from react-native-pin-view.

hosseinpro avatar hosseinpro commented on July 25, 2024

yes. thank you.

from react-native-pin-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.