0

试图自定义单选按钮。它适用于背景或按钮大小,但不适用于图标大小、颜色和定位。

有什么问题?

这是我的代码和结果。

Radio.js

import { Platform } from "react-native";

import variable from "./../variables/platform";

export default (variables = variable) => {
  const radioTheme = {
    backgroundColor: '#000',
    width: 20,
    height: 20,
    lineHeight: 20,
    ".selected": {
      color: '#7ED321',
      "NativeBase.IconNB": {
        color: '#7ED321',
        lineHeight: '20',
        fontSize: '20'
      }
    },
    "NativeBase.IconNB": {
      color: '#7ED321',
      lineHeight: '20',
      fontSize: '20'
    }
  };

  return radioTheme;
};

这是按钮的位置、大小和颜色。(颜色应该是绿色的十六进制)

在此处输入图像描述

4

1 回答 1

0

您可以从 native-base-theme/variables/*.js 更改单选按钮颜色和单选按钮大小

对于尺寸,只需根据您的平台对尺寸进行适当的更改

radioBtnSize: platform === "ios" ? 25 : 23,

对于颜色返回您想要的颜色

get radioColor() {
  return "blue";
},
于 2018-03-20T06:36:45.000 回答