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

how to bind bind event in Card.Cover? #4111

Closed
Buzhifanji opened this issue Oct 4, 2023 · 2 comments
Closed

how to bind bind event in Card.Cover? #4111

Buzhifanji opened this issue Oct 4, 2023 · 2 comments
Labels
Card needs more info question Question related to the library, not an issue

Comments

@Buzhifanji
Copy link

please tell me how to bind click event when card cover on click。

I'am try to do this. But, it did not work.

<Card.Cover onPress={onClick} source={{ uri: 'https://img95.699pic.com/photo/50046/5562.jpg_wh300.jpg', }} />

I tried according to the official documentation,it can work.
However,I don't know how to distinguish the card.title card.content card.over。

can you tell me how to do it? Thank you so much

@Buzhifanji Buzhifanji added the question Question related to the library, not an issue label Oct 4, 2023
@lukewalczak
Copy link
Member

I do not entirely understand your question, could you please elaborate more on it? What are you trying to accomplish? What do you mean by distinguishing the card component?

@Buzhifanji
Copy link
Author

I'm very sorry, my description is not clear enough。

My question is how to bind the cover click event。

I want to do like this:

`
function demo() {
// title event
const onTitle = () => {
console.log('onTitle');
};

// content event
const onContent = () => {
console.log('onContent');
};

// can you tell me how to bind onCover event
const onCover = () => {
console.log('onCover');
};

return (

<Card.Title title={title} />

  <Card.Content>
    <Text variant="bodyLarge" onPress={onContent}>
      content
    </Text>
  </Card.Content>

  {/* how to bind cover event ? */}
  <Card.Cover
    source={{
      uri: 'https://img95.699pic.com/photo/50046/5562.jpg_wh300.jpg',
    }}
  />
</Card>

);
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Card needs more info question Question related to the library, not an issue
Projects
None yet
Development

No branches or pull requests

2 participants