Titanium Studio Alloy visual error in scrollview and view - iphone

Am new to Titanium studio Alloy i have two questions,
1, I created 2 view tag within window on xml file. while am executing last view only visible among the both view my code is
<Window class="container>
<View class="View1">
#content of view1
</View>
<View class="View2">
#content of view2
</View>
</Window>
In this code only last view(view2) is visible i want to visible both view.
2.In my ScrollView tag i have some content to visible. but scrollview content was osculating everywhere in the screen.
i want to be fix with in the screen.
can anyone help me
advance thanks...

You need to set the layout property on your window they are being drawn on top of each other

Related

Full height layout with NSSplitViewController with a Toolbar

I am working on a text editor app that needs an inspector sidebar for special actions with the text. I am therefore using an NSSplitViewController to manage the overall layout. I want the sidebar to take advantage of macOS' new full-height sidebars. I already have an NSWindow with a fullSizeContentView style mask. And my corresponding NSSplitViewItem has the property allowsFullHeightLayout set to true.
Unfortunately, I am still getting this layout:
Additional information:
The Inspector sidebar is an NSHostingView with a SwiftUI View wrapped inside.
When using the accessibility inspector, I can see that the sidebar layout is expanded all the way up, but the NSToolbar seems to be ignoring it.
I need to keep both the title and toolbar
It is possible to let the toolbar know that there's a split view divider by using a special NSToolbarItem. By creating a custom identifier and rendering it as an NSTrackingSeparatorToolbarItem, I was able to extend the line all the way up.
To make the inspector view background extend to full height layout, I had to use window.titlebarAppearsTransparent = true.
This blogpost helped me to figure out everything: https://christiangiacomi.com/posts/setup-nstrackingseparatortoolbaritem-macos11/

Resizing after animation in autolayout

I have constraint using Visual Formatting that looks like this...
V:|-75-[basic][photo(220)][tiles(75)]-0-[detail]-[remark(>=25)]-[spacer(25)]-[agent(>=150)]-50-[map]-15-[share]-15-[disclaimer]-(>=50)-|
The detail view has an event handler that when the view is click it expands from 50px to 800px. The event is working but the autolayout doesn't seem to handle the resizing. I have tried...
.needsUpdateConstraints()
.updateConstraints()
.layoutIfNeeded()
On all of the views including children and superviews.
Any ideas on how to get this to work?

Adding ViewController's View as subview to UIPageViewController in iOS 8 gives weird UINavigationBar while show/hide

I have been working on a project where I needed to show list of images with zoom / swipe feature as presented view modal. I created custom ImageViewer using ContainerView in which I have added UIPageViewController. And on demand, I added ImageViews over the UIPageViewcontroller's view. When user taps to imageView, the top UINavigation gets shown and hidden on toggle basis.
Everything worked as expected in iOS 7.1 and less. However when I tested the functionality in iOS 8 devices and simulator, the ImageViews were not added to UIPageViewController in TopLeft ( beneath UINavigationBar ). It is added below the NavigationBar as shown in bug_iOS_8.png below.
Once I touch the buggy view, it repositions itself to correct position as in image expected.png below.
I have created and tested the issue in sample project and it seems it is bug in iOS 8 itself with UIPageViewController. I went through couple of questions regarding weird behavior of UIPageViewController too. Please check the sample app here and kindly let me know if anyone has any hints on what is going on.
Thank you for your time and help.
PS: BTW I am using following version of Xcode.
Update 1:
I have tried as per the pin suggestions. However, the problem aligning is with the main view of UIViewController rather than its subview. In below image, Yellow is main View of UIViewController and red one is added subview, I added pin to "red" on in reference to superview "yellow" one. Please check following screen shots.
On startup.
After touch on screen.
Kind Regards,
check in storyboard for particular viewController and make sure Extended Edges >> Under top bars is not selected.
I had a very similar issue and the way i fixed it was select the view being added to the UIPageViewController in the storyboard and selected the pin options. Below in the image you can see the Constrain to margins options, make sure you unselect that. Also when choosing what view to pin it to make sure you select the superview and not the Top Layout Guide.
Curious are you hiding your nav controller like this?
[self.navigationController setNavigationBarHidden:YES];
also if you have multiple Nav controllers, you might need to check you are referencing the correct one.
If you want it to be hidden when you present the ViewController you should move it to
-(void) ViewWillAppear{
}

How to add facebook like icon in detail view?

I am working on a navigation based app. every cell has a detail view. i have textView in detail view which shows details of selected cell. is it possible to add a facebook like icon in the end of textView? and if no then how should i do that. thanx in advance.
You can put the icon after the textview, or you can overlay it on top of the textview. It's as simple as putting it there in interface builder:
or, just set the frame properties of the text view and the image view to overlap, and place the image view on top of the text view (simplest way is just to "addSubview" it 2nd, which will place it on top).

Problem setting autosizing in interface builder

I have two viewControllers, one is a subclass of UIViewController (autoresizes correctly), the other one is a subclass of a subclass of UIViewController.
I did a layout in Interface Builder, I tested my code in the Simulator and everything works as expected. But if I rotate the device my views don't resize.
So I went back to Interface Builder and found out that I cannot change the Resizing property of the "root"-UIView. So I opened another file and the resizing property is fixed there, too. But it is set to resizing in both direction. This is the behavior I want.
How can I change the autoresizing of the top UIView so it does what I want?
There are not so many subviews that it is impossible to start again from scratch, but I don't want to do this.
I ran into this before and it was incredibly frustrating. It turns out that when you have Simulated User Interface Elements turned on then you can't change the struts and springs like you want.
Go to Attributes tab (Cmd-1) and make sure that Status Bar, Top Bar, Bottom Bar, and Split View are all set to "Unspecified." Then go back to the Size tab (Cmd-3) and you'll be able to click the lines and changes your Struts and Springs. Then finally you can go back to Cmd-1 and turn those simulated elements back on.
I have a simplified answer:
Goto IB
Click on the 'ViewController'
Goto 'Attributes Inspector'
Change 'Size' to 'Freeform' (something other than 'Inferred')
What you have is this:
Change 'size' to 'freeform' & try now!
Now, it works! Go back & change it to 'Inferred' after you have set the Autoresizing masks.
Open Main.storyboard as source (do not forget, it is just an XML file) and replace "autoresizingMask" tag in the View with the following line:
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>