Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.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 Nativescript';s标签-不';是否根据新值更新其宽度?_Android_Angular_Nativescript_Stacklayout - Fatal编程技术网

Android Nativescript';s标签-不';是否根据新值更新其宽度?

Android Nativescript';s标签-不';是否根据新值更新其宽度?,android,angular,nativescript,stacklayout,Android,Angular,Nativescript,Stacklayout,我面临一个wierd宽度问题。我正在使用Nativescript文档中的Groceries示例应用程序 查看底部标签:“在此处注册”: 我们确实看到了所有的内容 现在-如果用户单击该标签-则会出现一个新文本: <Label width="auto" [text]="isLoggingIn ? 'Sign up here' : 'Back to login'" ></Label> 所以一开始是: 万岁 我看到了所有的内容但这是一个丑陋的黑客 问题:

我面临一个wierd宽度问题。我正在使用Nativescript文档中的Groceries示例应用程序

查看底部标签:“在此处注册”:

  • 我们确实看到了所有的内容
现在-如果用户单击该标签-则会出现一个新文本:

     <Label width="auto" [text]="isLoggingIn ? 'Sign up here' : 'Back to login'"  ></Label>
所以一开始是:

万岁

我看到了所有的内容但这是一个丑陋的黑客

问题:

如何设置标签宽度以自动显示所有内容而不进行裁剪


其他信息:

该标签及其stacklayout的Css:

.sign-up-stack {
    background-color: #311217;
}
.sign-up-stack Label {
    color: white;
    horizontal-align: center;
    font-size: 15;
    border-radius:10;
     border-color:#FF0000;
    border-width: 1;

}

您可以尝试将
textWrap=“true”
添加到该标签吗?

您可以尝试将
textWrap=“true”
添加到该标签吗?

答案是:

.sign-up-stack Label {
    ...
    width: 100%;
    text-align: center;
}
以及:

<StackLayout #signUpStack
                     class="sign-up-stack"
                     (tap)="toggleDisplay()"
                     translateY="50">
            <Label [text]="isLoggingIn ? 'Sign up here' : ' Back to login'"       ></Label>
        </StackLayout>

答案是:

.sign-up-stack Label {
    ...
    width: 100%;
    text-align: center;
}
以及:

<StackLayout #signUpStack
                     class="sign-up-stack"
                     (tap)="toggleDisplay()"
                     translateY="50">
            <Label [text]="isLoggingIn ? 'Sign up here' : ' Back to login'"       ></Label>
        </StackLayout>


尝试放置一个

tag@Aravind为什么是比尔?我不想要任何新的线路!我想在一行中看到“返回登录”我的错。很抱歉关于它。尝试放置一个

tag@Aravind为什么是比尔?我不想要任何新的线路!我想在一行中看到“返回登录”我的错。很抱歉关于它,我不想要新的线路。我想在一行中看到它,而不是“在这里注册”-我想看到:“‘返回登录’”,我不想要新行。我想在一行中看到它,而不是“在这里注册”-我想看到:“返回登录”