小编Pix*_*xxl的帖子

在 NativeScript 应用程序中与 TextField 交互时停止键盘覆盖

在使用用户可以输入的 NativeScript 应用程序视图时,本机应用程序键盘输入会覆盖TextField组件。虽然这不会阻止用户输入文本,但它会扰乱 UX 流程并且从 UI 的角度来看看起来很糟糕。

如何让键盘不覆盖输入,而是像其他本机应用程序一样出现在它下面?

更新 2

现在它不再覆盖,我注意到当我离开应用程序切换到另一个应用程序或挂起NativeScript 应用程序时,当我回到它时问题再次出现。我该怎么做才能坚持原来的行为?

javascript typescript nativescript nativescript-angular angular

6
推荐指数
2
解决办法
6758
查看次数

由于 TypeScript 错误,无法在类型化数组上使用 indexOf

我已经定义了一个Interface,创建了一个数组type Interface,现在正在尝试使用.indexOf,一个数组的方法,但我收到了 IDE 错误投诉,这对我来说毫无意义。希望这里有人能够提出解决这个问题的想法。

界面

export interface IAddress {
  name: string,
  registrationId: number
}
Run Code Online (Sandbox Code Playgroud)

代码

let friends: IAddress[];

// assume friends has a few elements...

let index = friends.indexOf((friend: IAddress) => {
  return !!(friend.name === 'some name');
});
Run Code Online (Sandbox Code Playgroud)

打字稿错误:

Argument of type '(friend: IAddress) => boolean' is not assignable to parameter of type 'IAddress'.
Type '(friend: IAddress) => boolean' is missing the following properties from type 'IAddress': registrationId
Run Code Online (Sandbox Code Playgroud)

:IAddress如果我要从旁边的键入的 def 中删除 ,friend: …

javascript typescript typescript-typings

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