简体   繁体   English

Android 和 iOS 标签行数 Angular/Nativescript

[英]Android and iOS Label line count Angular/Nativescript

I'm relatively new to Angular/Native/Mobile dev.我对 Angular/Native/Mobile 开发比较陌生。 I need to figure out the line count on a Label element, after it has been rendered on the screen.在 Label元素在屏幕上呈现后,我需要计算它的行数 I have been trying to find a solution online for a while now, with no result - maybe I'm searching for the wrong stuff?一段时间以来,我一直试图在网上找到解决方案,但没有结果 - 也许我正在寻找错误的东西? I really expected that would have already been implemented as part of Label/UILabel, I don't know, I'm lost.我真的希望它已经作为 Label/UILabel 的一部分实现了,我不知道,我迷路了。 Any ideas would be greatly appreciated.任何想法将不胜感激。 Thanks!谢谢!

After giving the documentation another look, I figured it out.再看一遍文档后,我想通了。 Nativescript's Label is based onAndroid's TextView , there is, of course, an implementation for line count - to get it, just use getLineCount() . Nativescript 的 Label 是基于Android 的 TextView ,当然,有一个行数的实现 - 要获得它,只需使用 getLineCount() 。 Can't believe I missed that before.不敢相信我以前错过了。 Thought I'd post the answer anyway, for anyone else, who's great at overlooking obvious things, like me.我想无论如何我都会发布答案,对于像我这样擅长忽略明显事物的其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在android和nativescript angular中禁用ios中的截图 - How to disable screenshot in android and ios in nativescript angular 带有Angular 2的Nativescript中的Android小部件 - Widget for Android in Nativescript with Angular 2 Nativescript:在 Android 上显示徽章计数 - Nativescript: Display badge count on Android 如何在 iOS 中显示底部导航栏和在 Android (NativeScript Angular) 中显示顶部导航栏? - How to display Bottom Navigation bar in iOS and Top Navigation bar in Android (NativeScript Angular)? 我如何在iOS / Android中嵌入NativeScript Angular应用程序并导航到现有应用程序中的某些路由 - How can i embed an NativeScript Angular app in iOS / Android and navigate to certain routes from the existing app 问题升级 Nativescript angular 到 angular 9:在 ZC31B32364CE19CA8ZFCD150A417ECCE58 上运行 - Issue upgrade Nativescript angular to angular 9: Running on android 在 Nativescript Ios & Android 中创建一个简单的 href 链接 - Make a simple href link in Nativescript Ios & Android Telerik NativeScript和Android Keystore和iOS钥匙串 - Telerik NativeScript and Android Keystore and iOS keychain 使用适用于iOS和Android的本机库(本机) - Use native libary for iOS and Android (Nativescript) Nativescript在android和ios中访问localhost访问 - Nativescript accessing localhost access in android and ios
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM