flexbox

React Native 入门实战视频教程(36 个视频)

懵懂的女人 提交于 2020-07-27 08:50:05
React Native 入门实战视频教程(36 个视频) #1 React Native 课程介绍 「02:14」 #2 搭建 React Native 开发与运行环境跑起来 「05:07」 #3 演示在 Android Studio 模拟器中运行 App part 1 「07:40」 #4 演示在 Android Studio 模拟器中运行 App part 2 「Pro」「03:26」 #5 在 iOS 模拟器中运行 app 「Pro」「05:09」 #6 View, Text & 样式 (styles) 「Pro」「09:52」 #7 使用 state 「Pro」「05:52」 #8 React Native TextInput 「Pro」「06:09」 #9 列表 & ScrollView 「Pro」「05:45」 #10 使用更好的 FlatList 「Pro」「05:04」 #11 Touchable 组件 「Pro」「05:57」 #12 todo app (part 1) 「Pro」「06:14」 #13 todo app (part 2) 「Pro」「08:57」 #14 Alert 框 「Pro」「04:30」 #15 Keyboard dismiss 「Pro」「02:52」 #16 flexbox 「Pro」「10:31」 #17 React Native

Class 与 Style 绑定

99封情书 提交于 2020-07-25 05:37:24
操作元素的 class 列表和内联样式是数据绑定的一个常见需求。因为它们都是 attribute,所以我们可以用 v-bind 处理它们:只需要通过表达式计算出字符串结果即可。不过,字符串拼接麻烦且易错。因此,在将 v-bind 用于 class 和 style 时,Vue.js 做了专门的增强。表达式结果的类型除了字符串之外,还可以是对象或数组。 绑定 HTML Class 观看本节视频讲解 对象语法 我们可以传给 v-bind:class 一个对象,以动态地切换 class: < div v-bind:class= "{ active: isActive }"> </ div> 上面的语法表示 active 这个 class 存在与否将取决于数据 property isActive 的 truthiness 。 你可以在对象中传入更多字段来动态切换多个 class。此外, v-bind:class 指令也可以与普通的 class attribute 共存。当有如下模板: < div class= "static" v-bind:class= "{ active: isActive, 'text-danger': hasError }" > </ div> 和如下 data: data: { isActive: true, hasError: false } 结果渲染为: <

Aligning the child elements of different parent containers

允我心安 提交于 2020-07-20 07:37:50
问题 I'm trying to vertically align variable height elements across containers, i.e. the 1st element in each container aligns vertically with each other, the 2nd element in each container aligns vertically with each other, etc., etc. I'm using flexbox but not sure if this is even possible? Or is it possible using CSS Grid? Desired outcome See demo where I haven't managed to get it working yet. main { display: flex; flex-wrap: wrap; } .container { background: grey; margin: 0 10px 20px; padding:

Inline SVG Disappears with Flexbox

六眼飞鱼酱① 提交于 2020-07-20 07:20:10
问题 I am trying to center an inline SVG element both vertically and horizontally using Flexbox. For some reason when I display: flex on the parent container, the inline SVG just disappears. body { background-color: #000; margin: 0; border: 0; outline: 0; } .flexbox-container { display: flex; align-items: center; justify-content: center; } <div class="flexbox-container"> <div> <svg id="logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 598.6 323.5"> <title>We Will Not Be Silent</title> <g>

How to properly highlight text in React Native?

大兔子大兔子 提交于 2020-07-20 07:08:41
问题 I would like to highlight a multiline text in a React Native app by changing the text's background color. The problem is that the background color changes in the whole text area, not just under the words. class Example extends Component { render() { const text = '...'; return ( <View style={styles.textContainer}> <Text style={styles.textStyle}> {text} </Text> </View> ); } } const styles = StyleSheet.create({ textContainer: { flexDirection: 'row', flexWrap: 'wrap', width: 200, }, textStyle: {

React Native Stylesheet: what does {flex:1} do?

早过忘川 提交于 2020-07-16 15:57:56
问题 React Native uses flexbox for layout. In all of the examples I've seen, they do something like this: var styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'row' } }); I'm curious about the flex: 1 part. Based on Chris Coyier's definition here https://css-tricks.com/snippets/css/a-guide-to-flexbox/, flex: 1 should be the same as flex-grow: 1 , but to me it looks like flex: 1 in React Native is equivalent to display: flex in CSS. Here's a CodePen that demonstrates that flex: 1

Flexbox: Reverse Direction on Wrap / “Snake Wrap”

℡╲_俬逩灬. 提交于 2020-07-13 12:49:16
问题 I would like to find a way to have elements in a single container wrap to a new line going the opposite direction of the previous line, like a snake curving back on itself. I have not been able to achieve this result with flexbox and any combination of flex-direction and flex-wrap properties. Image comparison of flexbox result vs desired result: And here is a snippet showing the flexbox result vs desired result (faked): body { font: 400 14px 'Arial', sans-serif; } .title { font-size: 1em;

Flexbox: Reverse Direction on Wrap / “Snake Wrap”

家住魔仙堡 提交于 2020-07-13 12:48:47
问题 I would like to find a way to have elements in a single container wrap to a new line going the opposite direction of the previous line, like a snake curving back on itself. I have not been able to achieve this result with flexbox and any combination of flex-direction and flex-wrap properties. Image comparison of flexbox result vs desired result: And here is a snippet showing the flexbox result vs desired result (faked): body { font: 400 14px 'Arial', sans-serif; } .title { font-size: 1em;

Unequal row heights in a flex column

ぃ、小莉子 提交于 2020-07-09 19:38:14
问题 I'm trying to make a layout like the picture below but I don't know how to specify the column to make it be like a part of it 3/4 the column and the other part is 1/4, I'm trying to use flexbox This what I want the layout looks like: I don't know how to make what I'm saying up there :D as am still new to flexbox. but down below my attempt to create this thing, but i couldn't make the first column consists of two unequal rows. .container { display: grid; width: 100%; height: 45vw; margin: auto

Unequal row heights in a flex column

混江龙づ霸主 提交于 2020-07-09 19:36:19
问题 I'm trying to make a layout like the picture below but I don't know how to specify the column to make it be like a part of it 3/4 the column and the other part is 1/4, I'm trying to use flexbox This what I want the layout looks like: I don't know how to make what I'm saying up there :D as am still new to flexbox. but down below my attempt to create this thing, but i couldn't make the first column consists of two unequal rows. .container { display: grid; width: 100%; height: 45vw; margin: auto