Is it possible to use Auto Layout on some View Controllers and Autoresize on others? (Swift 4) - uiviewcontroller

I am trying to use Autoresize on some of my View Controllers Auto Layout on others. Everything looks fine on all device sizes when I use the "View As:" tool in Storyboards. There are no overlaps and everything fits nicely. However, I have Auto Layout Warnings:
Why am I getting these warnings if nothing is clipping or overlapping? And how do I get rid of them?

Well I think you don't need to do any special steps, just try adding auto-layout margins using (control + actions told) storyboard and xCode will automatically handles them separately.
Other controllers that you have made ready using Auto-resizing would not be effected by this.
And new controller you made ready with auto-layout would work fine as well.
Hope this would work out for you.
For reference adding 2 screenshots (both are from same xCode project) for you to be clear of that what I am trying to say...

if you don't want to use auto layout just disable it.
select ViewController in storybored,go to file inspecter -> locate the Interface Builder Document section.uncheck use Autolayout.

Related

How to use scrollbar plugin in Angular 6 app?

I'm creating an app in Angular 6 and I want to change all the scrollbars to a custom one. I'm aiming for something similar to the Mac OS scrollbar;
Transparent
Over the content
Shows on mouse over
I want a method that will replace all and any scrollbar that will appear in the app to this custom one without altering the html.
I've been looking for an Angular/Typescript plugin to do this but each one I found is suggesting that I wrap my content in it's related selector. Which is not something I want to do. Or am I not understanding how to use this?
This one plugin I'm looking at: https://www.npmjs.com/package/ngx-perfect-scrollbar
Is there a way to use this plugin without wrapping my content with <perfect-scrollbar>?
Sorry, I'm very new to Angular :(
I was also looking into Custom CSS scrollbars but that only works for webkit browsers.
just use this :
const ps = new PerfectScrollbar('.scroll-container');
and set scroll-container class on all the elements that need scroll

How to force invalidation in Flex 4 TextArea component?

I have a TextArea in a mobile application that I want to force invalidation on a certain event. So far I can do this:
myTextArea.width = myTextArea.width + 1;
I know it works because the text area updates correctly.
I've tried to do it "correctly" using the following:
testing.invalidateProperties();
testing.invalidateDisplayList();
testing.invalidateSize();
testing.validateNow();
parentGroup.invalidateProperties();
parentGroup.invalidateDisplayList();
parentGroup.invalidateSize();
parentGroup.validateNow();
None of the previous code works.
The TextArea is using the StageTextAreaSkin.
UPDATE
This seems to work as well as setting the width but is also a hack and also doesn't sync with the rest of the components:
testing.skin.styleChanged("anything");
The only way I've found to force a validation is to call myTextArea.setStyle("anything_here") or myTextArea.skin.setStyle("anything_here"). Note, it may be the fault of the skin, it is a mobile spark skin from the SDK (not my own creation). Better answers are appreciated.

Child content view controller view has wrong bounds size from Storyboard?

This document outline from my sample Storyboard shows what I'm working with.
I have a custom container view controller and two content view controllers connected via embed segues.
Here is the storyboard itself.
ZetaViewController has to create some programmatic views (within ZetaView, of course). I noticed when I was centering these programmatically created views they seemed really off center.
ZetViewController is centering things by examining self.view.bounds.size.height and self.view.bounds.size.width and doing some appropriate arithmetic.
When I added debug logging to ZetaViewController, I noticed that self.view.bounds.size.height and self.view.bounds.size.width had dimensions equal to ContainerView (768 x 1004) and not ZetaView (728 x 637). The Size Inspector in IB confirms these values.
I created a distinctive value for the tag attribute of ZetaView and logged it. ZetaViewController.view really is ZetaView because the tag value confirms it.
So what is going on? Why would ZetaView, shown clearly with smaller dimensions on the Storyboard and in the Size Inspector, show the wrong values in it's properties during run time?
My problem had nothing to do with Storyboards, segues, or custom container view controllers vs content view controllers. It had to do with the new Cocoa Auto Layout features introduced in iOS 5.
My problem arose from inspecting view bounds size in viewDidLoad instead of in viewWillLayoutSubviews. At the time viewDidLoad is called, the view controller's view has not been given its proper size yet. When I moved the code which programmatically centers views to viewWillLayoutSubviews, it worked as I expected. I still leave view creation code in viewDidLoad because viewWillLayoutSubviews is called repeatedly as layout changes.
See also the View Programming Guide for iOS section "Tweaking the Layout of Your Views Manually".
Ok,I'm going to point to an excellent post that I found: (updated)
http://kevindew.me/post/18579273258/where-to-progmatically-lay-out-views-in-ios-5-and
I was having an awful time adding shadow calayers to views after autolayout had done its magic. viewDidLoad, viewWillLoad etc did not have everything correctly laid out.
viewWillLayoutSubviews is called quite a few times and the state isn't fully set up. However... In viewDidLayoutSubviews, finally everything was set up as I expected.

AS3 - Keeping scrollbars on empty ScrollPane

In my app I'm using a ScrollPane. I can load a DisplayObject into it, and it works fine. The thing is that when it's empty, i.e. I haven't loaded anything into it, there aren't any scrollbars on the pane. This makes sense, since there's no scrolling to do, but I'd like there to be "greyed out" scrollbars if possible.
It's not necessary or anything but most programs have it (open an empty .txt file in Notepad and you'll see what I mean), I'd just like to know if my app can do this.
If it helps at all, it's an AIR app made using FlashDevelop with the open-source Flex 4 SDK. I'm getting my components (ScrollPane, etc.) from a SWC.
Set the vertical or horizontal scroll policy according to what you want.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/containers/BaseScrollPane.html#verticalScrollPolicy
scrollPane.verticalScrollPolicy=ScrollPolicy.ON;
scrollPane.horizontalScrollPolicy=ScrollPolicy.ON;

using PopUpManager in a Flex 4.5 Mobile App

This is more of a best practices question rater than something technical.
I'm working on a mobile app using the Flex 4.5 SDK and I'm trying to figure out the best way to handle notification windows. In most cases these windows will be alerting the user to when something goes wrong. Ex: bad login, no data, cannot resolve server.
I'm using a singleton design pattern, I have a Requests class that handles server calls. Most popups will be originating from this class (IOErrorEvents from my loader being used to access the API). Since this class is a singleton and is used from all Views inside the app it is not aware of applications current view. I'm also not sure having this class keep track of the current view and having it push popups on top of it would be best practice.
I'm hoping that I can use PopUpManager to keep track of where to add popups and what popups are currently on the stage. Though all examples I've seen online about this show static Components being used in a views Declarations tag.
I'm really just looking for any examples or input on how you would solve this problem. Any help would be greatly appreciated!
I had the same problem, and sorted it by making an Alert popup component that you can call from anywhere in the code base, and it will pop up in the currently active window. It also has an always visible scrollbar text area which is handy
http://bbishop.org/blog/?p=502
It works for a view navigator application, but if your using a tabbed navigator application, you can add a call for that, or simply change the code to
mainTabbedNavigator = FlexGlobals.topLevelApplication.tabbedNavigator;
currentTab = mainTabbedNavigator.selectedNavigator as ViewNavigator;