- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
我目前正在尝试在屏幕右下角的 ScrollView 上显示一个按钮,但它不起作用。当我 ScrollView 时,按钮会移动。我试着先插入按钮,但 ScrollView 在它上面。
class HomePage extends Component {
loadUserItems() {
this.props.loadUserItems();
}
constructor(props) {
super(props);
this.loadUserItems();
}
render() {
return (
<Container>
<Content>
<Header />
<View>
<ItemSquareDisplay
items={this.props.items && this.props.items.length > 0
? this.props.items
: ''} />
</View>
<Button style={styles.buttonStyle}>
<Text style={styles.buttonTextStyle}>+</Text>
</Button>
</Content>
</Container>
);
}
}
// CONNECTE LES PROPS DE CETTE CLASSE AUX STATES DE REDUX
const mapStateToProps = state => {
return {
items: state.items.items,
};
};
// PERMET A CETTE CLASSE DE LINKER LES PROPS AUX ACTIONS DE REDUX
export default connect(mapStateToProps, {loadUserItems}) ( HomePage );
const styles = {
headerViewStyle : {
alignItems: 'center',
backgroundColor: '#cc003d',
height: 90
},
headerImageStyle : {
height: 80,
width: 250,
resizeMode: 'contain',
marginTop: 7,
},
buttonStyle : {
backgroundColor: '#fc454e',
width: 66,
height: 66,
borderRadius: 33,
justifyContent: 'center',
alignItems:'center',
position: 'absolute',
bottom: 20,
right: 20
},
buttonTextStyle : {
color:'white',
fontSize: 45,
marginBottom: 6
}
}
我试过“固定”位置,但 react-native 不支持它。我希望按钮位于我的元素上方。
但我不希望它在我 ScrollView 时移动。
最佳答案
好的,我明白了:
render() {
return (
<View>
<Header />
<ScrollView>
<View>
<ItemSquareDisplay
items={this.props.items && this.props.items.length > 0
? this.props.items
: ''} />
</View>
</ScrollView>
<Button style={styles.buttonStyle}>
<Text style={styles.buttonTextStyle}>+</Text>
</Button>
</View>
);
}
很明显,我需要从容器组件中提取按钮。谢谢你们的回答。
关于css - ScrollView 上的固定按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49509604/
我正在尝试创建一个类似于 BBC 新闻 native 应用程序的布局(使用known.js);一个垂直的ScrollView,其中有许多水平的ScrollView。我已经“工作”到了一切都渲染并且水平
我正在尝试创建一个类似于 BBC 新闻 native 应用程序的布局(使用known.js);一个垂直的ScrollView,其中有许多水平的ScrollView。我已经“工作”到了一切都渲染并且水平
我已经为以下问题寻找了很多答案,但没有找到合适的解决方案(也不是“不可能”)。我不想要双向 ScrollView! 我想要的只是拥有这样的东西: 如果我这样做(具有所需的布局属性),我会得到我的
我想使用 famo.us 标准 Scrollview但是有一个以不同速度滚动的背景图像以产生视差效果。 我想知道是否有一种方法可以连接到事件流,或者以某种方式将 Scrollviews 位置通过管道传
初始化程序中有一个带有 ScrollView(alwaysBounceVertical: false) 的属性,但我似乎找不到它了。 有谁知道如何禁用 SwiftUI ScrollView 上的垂直弹
在你说之前 “Google 说不要这样做” 请阅读我的所有问题!! 布局: ScrollView -> RelativeLayout -> ScrollView -> RelativeLayout 第
我想在 Windows 7 上创建一种体验(使用触摸),我可以在其中拥有一个只能垂直滚动的外部 ScrollViewer(它是屏幕的大小)。在那个 ScrollViewer 中,我将有几个其他的 Sc
我知道 Google 的人要求我们不要将 Scrollable View 放在另一个 Scrollable View 中,但他们是否有任何官方声明指示我们不要这样做? 最佳答案 试试这个 注意:这里
更新Xcode11 beta3后,我发现scrollview内部 View 的阴影会在边界处被切断,但在Xcode11 beta2中还可以。我只是使用底部填充来修复它,但我认为这不是一个好的解决方案。
我的 wpf 应用程序的结构如下: 我的目标是,如果 DataGrid 超过屏幕的高度来使用它自己的 Scrollviewer。目前只使用外部的 S
我在其他应用程序中使用了 ScrollView,只添加了 style={styles.container}与风格。然而,在这个应用程序中,我正在创建我的风格 alignItems:'flex-star
这是我的布局 xml。 ... 我已经尝试过此链接中的解决方案: ScrollView Inside ScrollVie
有没有办法在 nativescript 的 ScrollView 上隐藏滚动指示器?我试过 scrollBars='none' 和 css overflow='hidden' 但它不能同时工作。谢谢
所以我有一个 ScrollView ,里面有一个 TextView 。当文本的String长于屏幕宽度时,它只是在下一行中移动。我想通过在 ScrollView 中添加 HorizontalScr
我正在尝试在 android 的水平 ScrollView 中创建一个水平 ScrollView 。第一个水平 ScrollView 工作正常。当我尝试滚动时,第二个水平 ScrollView 不起作
我在同一布局中创建了两个 ScrollView。你可以说一个平行的 ScrollView 。我想手动滚动一个 ScrollView ,作为响应,另一个 ScrollView 应该以完全相同的方式滚动。
我在 android 中设计 UI,我在另一个 HorizontalScrollView 中有一个 HorizontalScrollView。但是,子 HorizontalScrollVi
我在另一个 ScrollView 中有 ScrollView 。我想滚动内部 ScrollView ,但外部 ScrollView 只滚动。如何解决这个问题? 谢谢。 最佳答案 sv01 =
我有两个 UIScrollView,如果用户在 ScrollView 中滚动,我想让另一个 ScrollView 也滚动。我已经阅读了一个解决方案,涉及将 pangesturerecognizer 从
我以编程方式创建了 UIScrollView 并向其中添加了多个 button。 它运行良好,没有任何问题。 但我需要通过复制先前 ScrollView 的内容来创建另一个 ScrollView 。
我是一名优秀的程序员,十分优秀!