ReactNative的 view某些屬性

屬性:

numberOfLines 文本行數限制,添加後超過限制行數文本會在末尾默認以…的形式省略。

ellipsizeMode 設置文本縮略格式,配合numberOfLines使用,values:

    tail:在末尾...省略(默認值)

    clip:在末尾切割,直接切割字符無省略符

    head:在前面...省略

    middle:在中間...省略

onPress 點擊事件

style 樣式

accessible:表示此視圖時一個啓用了無障礙功能的元素。默認爲true

onMagicTap:當accessible爲true時,雙擊View會調用此函數。

onMoveShouldSetResponder:觸摸控件並滑動時調用的方法

onMoveShouldSetResponderCapture:觸摸控件並滑動時調用的方法,避免子視圖響應

onResponderMove:用戶在View上移動手指調用

onResponderRelease:結束觸摸時調用

pointerEvents:控制當前視圖是否可以觸控'box-none', 'none', 'box-only', 'auto'

樣式:

width:寬度

height:高度

backgroundColor:背景顏色

backfaceVisibility:是否顯示翻轉’visible’,‘hidden’

borderColor:邊框顏色

borderWidth:邊框寬度

borderRadius:邊框圓角半徑

borderStyle:邊框樣式’solid’實線,'dotted’點, 'dashed’虛線

borderTopColor:上邊框顏色

borderTopWidth:上邊框寬度

borderTopLeftRadius:左上角邊框圓角的半徑

borderTopRightRadius:右上角邊框圓角的半徑

overflow:內容超過容器時超出顯示還是隱藏’visible’, ‘hidden’

opacity:透明度

color 字體顏色

fontSize 字體大小

fontFamily 字體

fontStyle 字的樣式 (normal:正常italic:斜體)

fontWeight 設置粗體(normal:正常bold:粗體100,200,300, 400, 500, 600, 700, 800, 900)

lineHeight 行高

textAlign 文字對其方式(auto:自動對齊left:左對齊right:右對齊center:居中對齊)

textDecorationLine 下劃線和刪除線樣式(none:無線underline:下劃線line-through:刪除線underline line-through:下劃線和刪除線)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章