Sample code for React Native floating button component

亚连
Release: 2018-05-26 15:18:55
Original
1867 people have browsed it

This article mainly introduces the sample code of the React Native floating button component. The article introduces the sample code in very detail. It has certain reference learning value for everyone's study or work. Friends who need it can take a look together. .

React Native floating button component: react-native-action-button, a pure JS component, supports Android and IOS dual platforms, supports setting sub-buttons, and supports custom positions, styles and icons.

Rendering

##Installation method

npm i react-native-action-button --save react-native link react-native-vector-icons
Copy after login

Because the react-native-vector-icons icon component is used, a link needs to be made. If you have already used react-native-vector-icons in your project, this step is not needed.

Sample code

  悬浮按钮组件示例    console.log("notes tapped!")}>    {}}>    {}}>     { alert('你点了我!')}} renderIcon={() => ( 新增 )} /> 
Copy after login

Main parameters Description

ActionButton

  1. size: The size of the button, the default is 56

  2. active: Whether to display the button

  3. position: The position of the button, which can be left center right

  4. offsetX: Offset position on the X axis

  5. offsetY: Offset position on the Y axis

  6. onPress: Click event

  7. onLongPress: Long press event

  8. buttonText: Button title

  9. verticalOrientation: The direction of the popup button, up or down

  10. renderIcon: You can customize the style of button display. The default is a plus sign

ActionButton.Item

  1. size: The size of the button, the default is 56

  2. title: The button title

  3. ## buttonColor: Button color
  4. onPress: Click event
  5. The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Analysis and solutions to the reasons why the data obtained by Ajax is not displayed in echarts


Usage Object encapsulates the method of ajax repeated calls


Implements ajax cross-domain request based on iframe to obtain ajax data in the web page


The above is the detailed content of Sample code for React Native floating button component. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!