标签: textinput

如何使用select()在C中读取键盘输入

我试图使用select()来读取键盘输入,我陷入了困境,我不知道如何从键盘读取并使用文件描述符这样做.我被告知使用STDIN和STDIN_FILENO来解决这个问题,但我仍然感到困惑.
我该怎么做?

c keyboard stdin textinput select-function

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

输入对话框搅拌器

如何在blender中创建一个简单的输入对话框(如图中所示)并处理通过python输入的文本.我无法找到任何好的教程.

简单的入口盒

textinput blender blender-2.61

9
推荐指数
1
解决办法
5647
查看次数

如何在Android中使TextInput显示输入文本的开头而不是结尾?

TextInput的本机应用程序中有一个。当我设置值prop且该值比的长度长时TextInput,它显示的是从结尾开始而不是开头的文本。在iOS中可以正常使用,这似乎是Android问题。有没有一种方法可以使文字从的开头显示,TextInput还是首选?

这是我看到的:

在此处输入图片说明

这就是我要的:

在此处输入图片说明

这是我的代码

<TextInput
defaultValue={address}
ref="searchInput"
autoCorrect={false}
style={searchStyles.searchInputField}
placeholderTextColor={'#ddd'}
placeholder="Location"
onChangeText={query => this.search(query)}
/>
Run Code Online (Sandbox Code Playgroud)

android textinput react-native

9
推荐指数
4
解决办法
1589
查看次数

帮助WPF TextCompositionManager事件

这方面的文档非常粗制滥造.您可以连接许多事件来监视和控制通过TextCompositionManager访问的文本输入.如果您想要做一些像snag卡刷卡数据这样的事情,那就是你要做的事情.

有三个事件的关注文本输入: 的TextInput,TextStartTextUpdate.每个事件有两个版本,一个是事件隧道(从窗口向下移动到具有焦点的控件)以及当它冒泡(从聚焦的UI元素向上移动到窗口)时:

隧道:

  • PreviewTextInputEvent
  • PreviewTextInputStartEvent
  • PreviewTextInputUpdateEvent

冒泡:

  • TextInputEvent
  • TextInputStartEvent
  • TextInputUpdateEvent

因此,根据您在TextCompositionManager中挂钩的逻辑树中的位置,您可以在它们到达事件焦点之前修改这些文本事件,或者之后只查看它们.所有这些在文档和使用中都非常简单明了.


TL; DR

我找不到这三个事件的合理定义.可接受的答案不仅会定义三个事件(TextInput,TextInputStart和TextInputUpdate),还会比较和对比它们.没有分享答案,请参考您的来源和维基百科是不受限制的.你的成绩的25%取决于此.

wpf events textinput textcompositionmanager

8
推荐指数
1
解决办法
5031
查看次数

如何限制Shiny应用程序中textInput接受的字符数

我希望我的Shiny应用程序(在R中)限制用户响应textInput命令可以输入的字符数。

我可以要求用户限制为50个字符,并且可以让应用程序向他发送消息(如果他不这样做的话),但是如果阻止他一开始就超过了限制,那就更好了。

建议表示赞赏。

character-limit textinput shiny

8
推荐指数
2
解决办法
1259
查看次数

numberOfLines TextInput 属性不起作用

我在其中创建了一个应用程序,react-native并且可以选择在消息选项中聊天。当我在 TextInput 内部单击并键入两行时,上面的行被隐藏。为了解决这个问题,我在文档numberOfLines属性中看到了它,但它不起作用。

这是我的代码:

<TextInput

                ref='textInput'
                multiline={true}
                numberOfLines: {5}
                onChangeText={this.onChangeText}
                style={[styles.textInput, {height: context.props.textInputHeight}]}
                placeholder={context.props.placeholder}
                placeholderTextColor="#5A5A5A"
                value={context.state.text}/>
Run Code Online (Sandbox Code Playgroud)

我也在getDefaultProps函数中尝试过:

getDefaultProps() {
    return {
      placeholder: 'Type a message...',
      navHeight: 70,
      textInputHeight: 44,
      numberOfLines:5,
      maxHeight: Screen.height,
    };
  },
Run Code Online (Sandbox Code Playgroud)

但没有奏效。

javascript android textinput reactjs react-native

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

在TextInput中实现@mention

如何在React-native中的TextInput中实现@mention.

我已经尝试了这种反应本地提及但它不再维护了.有很多样式问题和回调问题.

我想要的是在textInput中显示这样的自定义视图.

建议清单视图

点击列表后我想显示如下:

在此输入图像描述

到目前为止,我能够实现:

当我在TextInput中键入'@'时,会出现用户列表.

在此输入图像描述

当我点击用户时,我在TextInput中获得用户名

在此输入图像描述

   renderSuggestionsRow() {
      return this.props.stackUsers.map((item, index) => {
         return (
            <TouchableOpacity key={`index-${index}`} onPress={() => this.onSuggestionTap(item.label)}>
               <View style={styles.suggestionsRowContainer}>
                  <View style={styles.userIconBox}>
                     <Text style={styles.usernameInitials}>{!!item.label && item.label.substring(0, 2).toUpperCase()}</Text>
                  </View>
                  <View style={styles.userDetailsBox}>
                     <Text style={styles.displayNameText}>{item.label}</Text>
                     <Text style={styles.usernameText}>@{item.label}</Text>
                  </View>
               </View>
            </TouchableOpacity>
         )
      });
   }

   onSuggestionTap(username) {
      this.setState({
         comment: this.state.comment.slice(0, this.state.comment.indexOf('@')) + '#'+username,
         active: false
      });
   }

   handleChatText(value) {
      if(value.includes('@')) {
         if(value.match(/@/g).length > 0) {
            this.setState({active: true});
         }
      } else {
         this.setState({active: false});
      }
      this.setState({comment: value});
   }
render() { …
Run Code Online (Sandbox Code Playgroud)

textinput mention react-native

8
推荐指数
1
解决办法
575
查看次数

默认下划线在 React Native 的 TextInput 中不可见

我是 React 原生开发的新手。在我的应用程序中,我有登录页面,在此登录页面中有两个文本输入。在此文本输入中没有下划线。我尝试了很多方法,但没有下划线。这里我的要求是需要输入文本的下划线。那么如何得到这个下划线呢?

这是我的登录表单代码。

import React, {Component} from 'react';
import {StyleSheet, Text, View,TextInput,TouchableOpacity} from 'react-native';

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>SEDC</Text>
      <TextInput placeholder="Acct No/User Id" style={styles.textInput} multiline={true}></TextInput>
      <TextInput placeholder="Password" style={styles.textInput}></TextInput>
      <TouchableOpacity style={styles.btn} onPress={this.login}><Text>Log In</Text></TouchableOpacity>
      </View>
    );
  }

  login=()=>{
    alert("testing......");
    // this.props.navigation.navigate('Second');
}
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },

  textInput: {
    alignSelf: 'stretch', …
Run Code Online (Sandbox Code Playgroud)

textinput react-native

8
推荐指数
2
解决办法
9681
查看次数

防止 TextInput 字段中的文本滚动和截断

TextInput我的应用程序中有React-Native字段,如果不将行高设置为非常大的值,则无法使字段中的文本不滚动并截断文本底部。

这是正在发生的事情的图像:

样式道具如下:

input: {
  height: 28, 
  paddingBottom: 0, 
  fontSize: 18,  
  color: '#000', 
  borderBottomWidth: 1.5,    
},
Run Code Online (Sandbox Code Playgroud)

有没有办法可以强制文本不在范围内移动TextInput

textinput react-native

8
推荐指数
1
解决办法
6711
查看次数

使用redux-form按下下一个键盘按钮后如何使用useRef钩子选择下一个TextInput

我知道我们可以使用 react 类方法轻松做到这一点。因为我们有 this.ref。但我不确定如何在功能组件中使用 useRef 钩子来做到这一点。

使用这里写的技巧

这就是我试图做到这一点的方式。

  ...

  const inputEl1 = useRef(null);
  const inputEl2 = useRef(null);
  return (
        <Field
            name="first_name"
            component={MyTextInput}
            placeholder="First name"
            ref={inputEl1}
            refField={inputEl1}
            onEnter={() => {
              inputEl2.current.focus();
            }}
          />
          />
          <Field
            name="last_name"
            placeholder="Last name"
            component={MyTextInput}
            ref={inputEl2}
            refField={inputEl2}
          />
)
...
Run Code Online (Sandbox Code Playgroud)

所以我需要将 ref from field 传递给 MyTextInput 并且在 nextKeyPress 上我想关注第二个输入组件,即 inputEl2

// 我的文本输入

...
render() {
    const {
      input: { value, onChange, onBlur },
      meta: { touched, error },
      keyboardType,
      placeholder,
      secureTextEntry,
      editable,
      selectTextOnFocus,
      style,
      selectable, …
Run Code Online (Sandbox Code Playgroud)

textinput reactjs react-native redux-form react-hooks

8
推荐指数
3
解决办法
8682
查看次数