1
我有一个如下所示的tableview行。如何在一行中放入内容并防止反应本机溢出?
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Text>{user.fullName}</Text>
<Button/>
</View>
以上呈现使名称粘在左边,按钮粘在右边。
-----------------------------------
User's Full Name Button
-----------------------------------
当用户的全名足够短时,这一切都很好。
但是,当用户的名字很长时。 这是它的外观。
-----------------------------------
User's Very Very Long Full Name Button
-----------------------------------
现在,行内容溢出行的宽度,并且按钮离开屏幕并变得不可见。
我想要的是这个。
-----------------------------------
User's Very Very Long... Button
-----------------------------------
如何通过flexbox模型实现此目的?
如何使name
增长并填充可用宽度但不超过?
请注意,Button
可以基于本地状态增长或缩小。
此外,是否有相当于text-overflow: ellipsis
上反应原生?