import React from 'react';
import { ScrollView, Text, View, TouchableOpacity } from 'react-native';
import { Tabs } from '@ant-design/react-native';
const renderContent = (tab, index) => {
const style = {
paddingVertical: 40,
justifyContent: 'center',
alignItems: 'center',
margin: 10,
backgroundColor: '#ddd',
};
const content = [1, 2, 3, 4, 5, 6, 7, 8].map(i => {
return (
{tab.title} - {i}
);
});
return {content};
};
export default class BasicTabsExample extends React.Component {
render() {
const tabs = [
{ title: 'First Tab' },
{ title: 'Second Tab' },
{ title: 'Third Tab' },
];
const tabs2 = [
{ title: '1st Tab' },
{ title: '2nd Tab' },
{ title: '3rd Tab' },
{ title: '4th Tab' },
{ title: '5th Tab' },
{ title: '6th Tab' },
{ title: '7th Tab' },
{ title: '8th Tab' },
{ title: '9th Tab' },
];
const style = {
alignItems: 'center',
justifyContent: 'center',
height: 150,
backgroundColor: '#fff',
};
return (
Content of First Tab
Content of Second Tab
Content of Third Tab
Custom RenderTabBar
(
{tabProps.tabs.map((tab, i) => (
// change the style to fit your needs
{
const { goToTab, onTabClick } = tabProps;
// tslint:disable-next-line:no-unused-expression
onTabClick && onTabClick(tabs[i], i);
// tslint:disable-next-line:no-unused-expression
goToTab && goToTab(i);
}}
>
{tab.title}
))}
)}
>
Content of First Tab
Content of Second Tab
Content of Third Tab
{renderContent}
);
}
}
export const title = 'Tabs';
export const description = 'Tabs example';
// fetch(uploadURL,{
// method:'POST',
// headers:{
// 'Content-Type':'multipart/form-data',
// },
// body:formData,
// })
// .then((response) => response.text() )
// .then((responseData)=>{
//
// console.log('responseData',responseData);
// })
// .catch((error)=>{console.error('error',error)});