新聞中心
組件封裝了滾動視圖平臺,同時提供了與鎖定“應答”系統(tǒng)的觸摸的集成。

在嵩明等地區(qū),都構建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務理念,為客戶提供成都網(wǎng)站設計、做網(wǎng)站 網(wǎng)站設計制作按需求定制網(wǎng)站,公司網(wǎng)站建設,企業(yè)網(wǎng)站建設,成都品牌網(wǎng)站建設,全網(wǎng)整合營銷推廣,成都外貿(mào)網(wǎng)站制作,嵩明網(wǎng)站建設費用合理。
尚不支持其他來自阻止?jié)L動視圖成為響應者的包含的響應。
Props
Edit on GitHub
alwaysBounceHorizontal 布爾型
當為真時,滾動視圖到達內(nèi)容底部時,水平反彈,即使該內(nèi)容小于滾動視圖。當 horizontal={true}時,默認值為 true,否則,默認值為 false。
alwaysBounceVertical 布爾型
當為真時,滾動視圖到達內(nèi)容底部時,垂直反彈,即使該內(nèi)容小于滾動視圖。當 horizontal={true} 時,默認值為 false,否則,默認值為 true。
automaticallyAdjustContentInsets 布爾型
bounces 布爾型
當為真時,當滾動視圖到達內(nèi)容底部時,反彈,如果內(nèi)容比滾動視圖是大,那么滾動視圖沿著軸滾動方向反彈。當為假時,禁用所有反彈,即使 alwaysBounce * 道具為真。默認值為 true。
centerContent bool 布爾型
當為真時,當內(nèi)容小于滾動視圖邊界時,滾動視圖自動的集中內(nèi)容;當內(nèi)容大于滾動視圖時,該屬性沒有任何影響。默認值是 false。
contentContainerStyle StyleSheetPropType(ViewStylePropTypes)
這些樣式將應用到滾動視圖內(nèi)容容器中,內(nèi)容容器包裝了所有的子視圖。例如:
return (); ... var styles = StyleSheet.create({ contentContainer: { paddingVertical: 20 } });
contentInset {頂部:數(shù)字型,左部:數(shù)字型,底部:數(shù)字型,右部:數(shù)字型}
contentOffset PointPropType
decelerationRate 數(shù)字型
一個浮點數(shù),決定了在用戶移開手指后,滾動視圖減速有多快。合理的選擇包括——正常:0.998(默認)——快速:0.9
horizontal 布爾型
當為真時,滾動視圖的子視圖水平排列為一行,而不是豎直排列為一列。默認值是 false。
keyboardDismissMode 枚舉型(“none”,“interactive”,“onDrag”)
確定鍵盤在響應一個拖動時是否被摒棄。——“none”(默認),拖動沒有摒棄鍵盤。——“onDrag”,當拖動開始時鍵盤就被摒棄了?!癷nteractive”,鍵盤被拖動交互式地摒棄并且與觸摸同步移動;向上拖動取消了摒棄。
keyboardShouldPersistTaps 布爾型
當為假時,當鍵盤向上摒棄鍵盤時,輕擊外部關注文本輸入。當為真時,滾動視圖不會抓取輕擊,鍵盤不會自動摒棄。默認值是 false。
maximumZoomScale 數(shù)字型
最大允許縮放比例。默認值是 1.0。
minimumZoomScale 數(shù)字型
最小允許縮放比例。默認值是 1.0。
onScroll 函數(shù)型
onScrollAnimationEnd 函數(shù)型
pagingEnabled 布爾型
當為真時,滾動視圖在滾動時會在滾動視圖的尺寸的倍數(shù)上停止?jié)L動。這可以用于水平分頁。默認值是 false。
removeClippedSubviews 布爾型
實驗:當為真時,屏幕以外的子視圖(它的 overflow 值是 `hidden )從本地備份的 superview 中刪除。這在長列表中可以提高滾動性能。默認值是 false。
scrollEnabled 布爾型
scrollEventThrottle 數(shù)字型
scrollIndicatorInsets {頂部:數(shù)字型,左部:數(shù)字型,底部:數(shù)字型,右部:數(shù)字型}
scrollsToTop 布爾型
當為真時,輕擊狀態(tài)欄滾動視圖會滾動到頂部。默認值為 true。
showsHorizontalScrollIndicator 布爾型
showsVerticalScrollIndicator 布爾型
stickyHeaderIndices [數(shù)字型]
一組子視圖表明確定當視圖滾動時哪些子視圖會??吭谄聊坏捻敹恕@?,傳遞 stickyHeaderIndices = {[0]} 將使得第一個子視圖固定在滾動視圖的頂部。此屬性不支持與 horizontal = {true} 結合。
style style
Flexbox...
backgroundColor 字符串型
borderBottomColor 字符串型
borderColor 字符串型
borderLeftColor 字符串型
borderRadius 數(shù)字型
borderRightColor 字符串型
borderTopColor 字符串型
opacity 數(shù)字型
overflow 枚舉型(‘visible’,’hidden’)
rotation 數(shù)字型
scaleX 數(shù)字型
scaleY 數(shù)字型
shadowColor 字符串型
shadowOffset {高:數(shù)字型,寬:數(shù)字型}
shadowOpacity 數(shù)字型
shadowRadius 數(shù)字型
transformMatrix [數(shù)字型]
translateX 數(shù)字型
translateY 數(shù)字型
zoomScale 數(shù)字型
當前滾動視圖內(nèi)容的規(guī)模。默認值是 1.0。
例子
Edit on GitHub
'use strict';var React = require('react-native');var {
ScrollView,
StyleSheet,
View,
Image
} = React;
exports.title = '';
exports.description = 'Component that enables scrolling through child components';
exports.examples = [
{
title: '',
description: 'To make content scrollable, wrap it within a component',
render: function() { return ( { console.log('onScroll!'); }}
scrollEventThrottle={200}
contentInset={{top: -50}}
style={styles.scrollView}>
{THUMBS.map(createThumbRow)}
);
}
}, {
title: ' (horizontal = true)',
description: 'You can display \'s child components horizontally rather than vertically',
render: function() { return (
{THUMBS.map(createThumbRow)}
);
}
}];var Thumb = React.createClass({
shouldComponentUpdate: function(nextProps, nextState) { return false;
},
render: function() { return (
);
}
});var THUMBS = ['https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-ash3/t39.1997/p128x128/851549_767334479959628_274486868_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851561_767334496626293_1958532586_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-ash3/t39.1997/p128x128/851579_767334503292959_179092627_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851589_767334513292958_1747022277_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851563_767334559959620_1193692107_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851593_767334566626286_1953955109_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851591_767334523292957_797560749_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851567_767334529959623_843148472_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851548_767334489959627_794462220_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851575_767334539959622_441598241_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-ash3/t39.1997/p128x128/851573_767334549959621_534583464_n.png', 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-prn1/t39.1997/p128x128/851583_767334573292952_1519550680_n.png'];
THUMBS = THUMBS.concat(THUMBS); // double length of THUMBSvar createThumbRow = (uri, i) => ;var styles = StyleSheet.create({
scrollView: {
backgroundColor: '#6A85B1',
height: 300,
},
horizontalScrollView: {
height: 120,
},
containerPage: {
height: 50,
width: 50,
backgroundColor: '#527FE4',
padding: 5,
},
text: {
fontSize: 20,
color: '#888888',
left: 80,
top: 20,
height: 40,
},
button: {
margin: 7,
padding: 5,
alignItems: 'center',
backgroundColor: '#eaeaea',
borderRadius: 3,
},
buttonContents: {
flexDirection: 'row',
width: 64,
height: 64,
},
img: {
width: 64,
height: 64,
}
});
當前標題:創(chuàng)新互聯(lián)React教程:滾動視圖
本文地址:http://m.fisionsoft.com.cn/article/ccdpogj.html


咨詢
建站咨詢
