我想在react native中隐藏动态生成的按钮 下面是我的代码。我使用了溢出:隐藏,但是它不起作用。
renderSeats() {
var seats = [];
var columnCount = 2;
for(var index = 0; index < columnCount; index++) {
var title = (index + 1).toString();
var isDisabled = false, isHidden = false;
if(title == 1) {
isDisabled = true;
isHidden = false;
}
if(isHidden)
seats.push(
<View hide={this.state.isHidden}>
<Button title={title} style={{overflow: "hidden"}} disabled={isDisabled}></Button>
</View>
);
else
seats.push(
<View style={{overflow: "hidden"}}>
<Button title={title} style={{overflow: "hidden"}} disabled={isDisabled}></Button>
</View>
);
}
return seats;
}
答案 0 :(得分:0)
# m is the matrix
# a is the array
result = [[y in range(x[0], x[-1]) for y in a] for x in m]
用于溢出的内容。
您可以尝试overflow: hidden
或display: none
。但是,这也可能不适用于本机。
相反,您不能渲染它:
visibility: hidden