Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 编写消息时动态大小textview nativescript_Android_Textview_Nativescript_Angular2 Nativescript - Fatal编程技术网

Android 编写消息时动态大小textview nativescript

Android 编写消息时动态大小textview nativescript,android,textview,nativescript,angular2-nativescript,Android,Textview,Nativescript,Angular2 Nativescript,我使用angular2在nativescript中创建了一个messagerie服务,比如whatsapp,当您在android平台上编写消息时,我对textview的大小大小有问题。我希望在你添加其他行(如whatsapp或facebook等)时增加高度 在IOS中,这很简单。点击链接 我的html模板位于屏幕底部: 要更改文本视图的大小,请在IOS中键入: textChanged() { if (isIOS) { this.textHeight =

我使用angular2在nativescript中创建了一个messagerie服务,比如whatsapp,当您在android平台上编写消息时,我对textview的大小大小有问题。我希望在你添加其他行(如whatsapp或facebook等)时增加高度

在IOS中,这很简单。点击链接

我的html模板位于屏幕底部:

要更改文本视图的大小,请在IOS中键入:

 textChanged() {
        if (isIOS) {
            this.textHeight = this.newMessage.ios.contentSize.height;
        } else{//ANDROID TODO}

这比你想象的要容易得多,只是不要将高度设置为TextView/将其设置为auto,使其增长到所需的高度。

这比你想象的容易得多,只是不要将高度设置为TextView/将其设置为auto,使其增长到所需的高度。

动态TextView高度。动态增加文本视图高度 它可以在安卓和ios上运行

<TextView height="auto" editable="true" hint="Write a message..." textWrap="true"[(ngModel)]="text" ></TextView>

动态文本视图高度。动态增加文本视图高度 它可以在安卓和ios上运行

<TextView height="auto" editable="true" hint="Write a message..." textWrap="true"[(ngModel)]="text" ></TextView>