小编smu*_*uvv的帖子

React-native阴影没有出现

我试图在我的观点下面留下一个阴影,从我在网上发现它应该很简单:

    shadowOffset: { width: 10, height: 10 },
    shadowColor: 'black',
    shadowOpacity: 1.0,
Run Code Online (Sandbox Code Playgroud)

但问题是阴影根本没有出现.

这是我的组件

      <View style={styles.shadow}>
        <View style={styles.box} >
          <View style={styles.ListComponent}>
            <Text style={styles.itemText}>Livestream</Text>
          </View>
        </View>
      </View>
Run Code Online (Sandbox Code Playgroud)

在我的StyleSheet中:

const styles = StyleSheet.create({
   shadow: {
   shadowOffset: { width: 10, height: 10 },
   shadowColor: 'black',
   shadowOpacity: 1.0
},
Run Code Online (Sandbox Code Playgroud)

有什么理由或有什么我错过了吗?

shadow react-native

20
推荐指数
5
解决办法
2万
查看次数

Android 相机教程-galleryaddpic 不起作用

我正在遵循“简单 地拍照Android 开发人员指南”,除了将图片保存到图库之外,一切似乎都正常工作。

所有代码均取自指南,如下所示:

我有一个启动相机意图的浮动操作按钮

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            dispatchTakePictureIntent();


        }
    });



 private void dispatchTakePictureIntent() {
    Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    // Ensure that there's a camera activity to handle the intent
    if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
        // Create the File where the photo should go
        File photoFile = null;
        try {
            photoFile = createImageFile();
        } catch (IOException ex) {
            // Error occurred while creating the File …
Run Code Online (Sandbox Code Playgroud)

java camera android

7
推荐指数
1
解决办法
1086
查看次数

将图像大小调整为视图 - 反应原生

我想知道是否可以调整图像大小以使其适合视图。

这就是我现在所拥有的

 <View style={styles.container}>
    <View style={styles.header}>
      <Image
        source={headerImage}    
      />

    </View>
    <Text style={styles.basicText}>text</Text>
  </View>
Run Code Online (Sandbox Code Playgroud)
 const styles = StyleSheet.create({
      container: {
        flex: 1,
        backgroundColor: "#fff"
      },
      header: {
        height: 200, 
        backgroundColor: 'red'
      },
      background: {
        width: null,
        height: null
      },
      image: {

      }
Run Code Online (Sandbox Code Playgroud)

我想让图像适合标题视图。

css android resize reactjs react-native

3
推荐指数
1
解决办法
6015
查看次数

标签 统计

android ×2

react-native ×2

camera ×1

css ×1

java ×1

reactjs ×1

resize ×1

shadow ×1