小编Far*_*rwa的帖子

Kotlin相当于Java的equalsIgnoreCase

equalsIgnoreCaseKotlin中用Java 比较String值的等价物是什么?

我已经使用equals但它不是不区分大小写的.

android kotlin

39
推荐指数
3
解决办法
9720
查看次数

OSX Yosemite上的Android Studio更新错误

当我在Android Studio(1.0.1)中检查更新时,它表示有可用的更新(1.0.2),但显示此错误:

Android Studio没有/ Applications/Android Studio.app/Contents的写入权限.请由特权用户运行以进行更新.

当我尝试以root身份打开它时,我收到一条错误消息,指出文件丢失且无法启动.

我该如何更新这些错误?我应该将其作为非特权用户安装吗?

编辑:我停止了这个错误的几个版本.

macos updates android-studio osx-yosemite

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

飞镖列表中三个点(...)的用法是什么?

我的代码是这样写的,但它给出了一个错误说:

错误:无法将“List”类型的值分配给“Widget”类型的变量。

Column(
  children: [
    Question(
      questions[_questionIndex]['questionText'],
    ),
    ...(questions[_questionIndex]['answers'] as List<String>)
        .map((answer) {
      return Answer(_answerQuestion, answer);
    }).toList()
  ],
)
Run Code Online (Sandbox Code Playgroud)

dart flutter

17
推荐指数
4
解决办法
7544
查看次数

如何在TextFormField中显示/隐藏密码?

目前我有我的密码TextFormField像这样:

TextFormField(
  decoration: const InputDecoration(
      labelText: 'Password',
      icon: const Padding(
        padding: const EdgeInsets.only(top: 15.0),
        child: const Icon(Icons.lock),
      )),
  validator: (val) => val.length < 6 ? 'Password too short.' : null,
  onSaved: (val) => _password = val,
  obscureText: true,
);
Run Code Online (Sandbox Code Playgroud)

我想要一个像交互一样的按钮,这会使密码可见和不可见.我可以在里面做TextFormField吗?或者我必须创建一个TextFormField小部件来获取我所需的UI.那么关于Stack真/假的条件如何?

android dart flutter

15
推荐指数
7
解决办法
2万
查看次数

Flutter - 如何检测 webview 内特定按钮的点击?

我可以跟踪或检测用户在 webview 中按下的按钮并根据我的 flutter 应用程序中的按钮做出逻辑决策吗?

我正在使用webview_flutter包。

android click button flutter flutter-web

9
推荐指数
0
解决办法
1542
查看次数

如何限制TextFormField中的字符数?

有没有办法在dart语言中保持最大输入长度固定TextFormField

dart flutter

7
推荐指数
3
解决办法
2939
查看次数

png 图像的透明部分显示白色

我在 Image 标签中有一个 png 图像。部分图像具有透明背景。在我的 android 手机中,它显示为白色。我希望移除白色部分并使其透明。

这是我的代码 -

export default class LoginScreen extends Component {
  render() {
    return (
      <View style={styles.container}>
        <View style = {styles.topContainer}>
        <Image style = {styles.logoContainer}
        source = {require('../images/black_header.png')} />
      </View>
     </View>
    );
  }
}


const styles = StyleSheet.create({
  logoContainer: {
    resizeMode: 'contain',
    backgroundColor: "rgba(0,0,0,0)",
    width: null,
    height: 254,
  },
  container: {
    backgroundColor: "#f7f7f7"
  },
  topContainer: {
    backgroundColor: "rgba(0,0,0,0)"
  }
});
Run Code Online (Sandbox Code Playgroud)

javascript react-native

6
推荐指数
1
解决办法
1548
查看次数

RecyclerView SCROLL_STATE_IDLE 被延迟调用

在 RecyclerView 上,在项目大小结束时以及向上滚动到 RecyclerView 顶部时,addOnScrollListener该属性需要一些时间才能被调用。SCROLL_STATE_IDLE但在滚动过程中效果很好。

布局的根视图是CoordinatorLayout。

scroll android-layout onscrolllistener android-recyclerview android-coordinatorlayout

4
推荐指数
1
解决办法
4395
查看次数

如何使TextField的背景为矩形框形状?

我尝试在中制作Container具有矩形形状的小部件TextField。它不会在容器内显示我的文本。相反,盒子的形状在上方TextField

这是我的代码:

 new Container(
            height: 10.0,
            width: 20.0,
              decoration: new BoxDecoration(
                shape: BoxShape.rectangle,
                border: new Border.all(
                  color: Colors.black,
                  width: 1.0,
                ),
              ),
            child: new TextField(
              textAlign: TextAlign.center,
              decoration: new InputDecoration(
                hintText: '1',
                border: InputBorder.none,

              ),
            ),
            ),
Run Code Online (Sandbox Code Playgroud)

dart flutter

4
推荐指数
2
解决办法
9826
查看次数

如果 RaisingButton.icon() 上构造函数中的图标值为 null,如何保持图标禁用?

我有一个常见的按钮小部件,它将图标值作为构造函数。有时我希望小部件没有可见的图标。我如何将该逻辑放入像这样的小部件中?

const SocialAuthBtn({this.action, this.title, this.textColor, this.bgColor, this.icon});

@override
  Widget build(BuildContext context) {
    return ButtonTheme(
      minWidth: double.infinity,
      height: UtilWidget.verticalBlock(7),
      child: RaisedButton.icon(
          onPressed: action,
          color: bgColor,
          label: Padding(
            padding: EdgeInsets.only(left: UtilWidget.horizontalBlock(2)),
            child: Text(
              title,
              style: TextStyle(
                fontSize: SizeConfig.blockSizeHorizontal + 10,
                color: textColor,
                height: 1,
              ),
            ),
          ),
          icon: Image.asset(
            icon,
            width: UtilWidget.horizontalBlock(4),
            height: UtilWidget.horizontalBlock(4),
          )
      ),
    );
  }
Run Code Online (Sandbox Code Playgroud)

android dart flutter flutter-layout

4
推荐指数
1
解决办法
9522
查看次数