How to code the ScrollView with images like this - xcode

I tried sample code in App Dev Center, but the code only can show images side by side and fill all scroll view, I want to realize like attached picture, who can give me some thoughts? Thanks~!

The width of a "page" when you use a paging scroll view is the width of the scroll view itself. So if you want to use that feature, the scroll view must be the width of the pix plus half the width of the borders on either side, so that the next picture will come into place correctly. Now, if you don't want to hide the picture at the right before it's been paged into the scroll view, just don't turn on clipsToBounds.

Related

React Native bunch of buttons on top of background image

I have a background image and I need to add bunch of oval buttons or images on in my case the "greenish" buttons on top of the background image, that I can click in each one of them and call a function passing a parameter. Please look on the screen shot and let me know how I can position every one of the buttons on top of the image and access them with a click (onPress). I guess the only way is using flex box but I couldn't figure out the style for it.
Thanks
Just style all the green buttons on relatively to the image's boundaries with position: absolute. Percentage values for positioning should work, if your image scales properly on screen size change.

Autoresize header to stay on one row

I'm currently customizing wordpress layout for one company and I have a problem with layout.
I have a logo in header and to the right of it is navigation. But when I'm zooming in, at one point the navigation skips to the next row.
I'd like to ask you how should I keep them on one row when zooming.
Page can be found on dev.machala.cz
Thanks in advance for answers.
When you zoom your page that means viewport size is getting lower and your page starts using your Media Query for that width.
If you don't want to break your menu to down. You have to remove your Media Query.
This is not an issue. You can leave it as it is.
If you are trying to do this for layout purposes on mobile and tablet maybe consider this -
Try changing the font size of the menu text to:
font-size: 1vw;
and then change the media query for the of the mobile menu toggle bar to 1000px
and set the font size back to normal in that media query.
Using VW make the font scale with the width of the browser.
Doing this means you'll be able to shrink the browser for slightly longer and then the media query for the toggle will appear sooner avoiding the text moving to a new row.

How to get background images to scale to the same size in Xcode Autolayout?

The Problem:
I am currently trying to get the background image of launch page of my app and the first view controller to match in size.
On left, launch screen on the right first view controller.
However as you can see the navigation bar appears to resize the background image.
Both back ground images are currently set to centre vertically and horizontally and both have equal width and height to the view.
What Ive tried
I have obviously tried messing around with auto layout to now avail,
I have also tried toggling the Extend Edges “under Top Bars” option, it is currently set to true in the above image. This didn't work either.
Question
How do I get both background images to have the same sizes (consistent) between the launch screen and the first view controller, for all iPhone devices (in auto layout)?
Found the answer for anyone with this problem.
Tick extend edges under Opaque bars for the view controller.

Windows store apps Hub Control Horizontal Offset

How is it possible to determine the horizontal offset of the Windows 8.1 HubControl?
I would like to adjust the margin of my title by the amount of horizontal offset.
Interestingly I notice in the Bing News app that the title 'Bing News' starts off white when it is over the lead image. However, when you scroll right, and the title is now over the application's (light) background (having scrolled past the image), the title background colour now changes to black.
See image below. Shows the top most part of the screen. Images 1-3 show when the page has scrolled right and the BING NEWS title has changed colour once it is no longer over the image.
I assume this is done via the offset again so I hope that my idea is possible.
The Hub control has a child element which is a ScrollViewer. You can parse the visual tree to retrieve the ScrollViewer, or you can use some neat extensions such as the ones in WinRTXamlToolkit which allow you to do a call such as myHubControl.GetFirstDescendentOfType<ScrollViewer>(). Then, you can retrieve the HorizontalOffset from this object.

Set margins of view xcode

I have been programming android apps for a bit, and I am now making an iphone app. I want to make margins for my view. I would not like to explain my exact situation, but if someone helps me with this I'll be able to figure out what I need to do.
I have two views, I want the first view to take up the entire screen. Then I want another view to always be, lets say 20 pixels from the edge of the screen on all four sides. Is there a simple way to do that in xcode?
Thanks
I assume you're using Interface Builder (now part of Xcode).
Add the view as you suggest - leaving a 20 pixel border around all 4 sides. Set all 6 resize options (flexible height, width, top, bottom, left & right).
Ensure that 'autoresize subviews' is enabled on the parent view.
The view will now resize if the parent view also resizes, leaving a 20px margin as required.

Resources