ActionBar.titleView out-of-position if re-rendered after delay - iOS 11
See original GitHub issueWhich platform(s) does your issue occur on?
iOS 11
Please provide the following version numbers that your issue occurs with:
- CLI: (run
tns --version
to fetch it) - Cross-platform modules: 3.1.1
- Runtime(s): tns-ios 3.1.0
- Plugin(s): no plugins
Please tell us how to recreate the issue in as much detail as possible.
This only happened in iOS 11 (I build it using XCode 9 Beta 5 or XCode 9 Beta 6) It happened on both simulator and device (iOS 11 Beta 7) In page’s loaded event handler:
- Create a Label
- Create assign the label to the page’s actionbar.titleView
- If you navigate this to this page from another page, the title position will be okay at first but if something trigger the re-rendering, it will be messed up (moved to the bottom-right corner).
This issue seems to be triggered when the ActionBar is re-rendered after a small delay (e.g. add new ActionItem or even just call the requestLayout function).
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
var page = args.object;
var actionBarTitleLabel = new label.Label();
var titleText = "DETAIL TITLE";
actionBarTitleLabel.text = titleText;
page.actionBar.titleView = actionBarTitleLabel;
//Set a delay that will trigger re-render of the ActionBar
setTimeout(function(){
page.actionBar.requestLayout(); //add new ActionItem can also trigger the same issue
},2000); //This issue can be triggered even if the delay is just 10ms
Attached is js files for the basic app that you can use to reproduce this issue app.zip
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:16 (3 by maintainers)
Top Results From Across the Web
ActionBar - NativeScript Docs
The ActionBar is NativeScript's abstraction over the Android ActionBar and iOS NavigationBar . It represents a toolbar at the top of the activity...
Read more >Nativescript Angular 6 - Adding Icon with String into Actionbar ...
For one of my pages, I want the Actionbar title to be a dropdown - so I want to show text with a...
Read more >Article 11 - Beginner's Guide to Android Animation/Graphics
This tutorial will be an afford to teach you the basics of Graphics and Animation in Android with as much fluidity as I...
Read more >tns-platform-declarations | Yarn - Package Manager
This plugin contains type information about the native platforms as exposed by the NativeScript framework. Offically supported entry points:.
Read more >A react-native module that can listen on orientation changing ...
If you get the following build error on iOS: ld: library not found for ... { //do something with landscape left layout }...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey Guys,
This issue has been addressed in the master branch as part of implementing more flexible composition and navigation with Frame, Page, and TabView.
The solution is available in
tns-core-modules@next
, the forthcoming official release is going to be 4.0.0.I have found perfect solution with custom title. it is working with
ios:horizontalAlignment="left"