What is the maximum width for frame in iPad Application? - ipad

my application like calendar view and i should set all views onload so should setup for every year 12 grid view but the iPad(3) give me memory worrying after build 13 grid view and it should cause it is a high data so i search for another way and i found something could infinite & StreetScroller but when i try it the data should be fix (ex: can't handle the position to change data load the next year) is that correct or i miss. up and there is a way to use this and i don't know it ???
plz help me to find to solution ???

From what I understand, you're implementing a calendar type view, and you get memory issues with large amounts of data.
In answer to the title of this question, there is no maximum width for a frame (I assume you mean UIView) in an iOS application. But, it is important to make sure you manage your memory correctly. For example, I could have a view that is 749202 pixels wide, and contains detailed charts/text/images/etc... If I filled out this View in full when it first loaded, the application would crash; it would use too much memory.
In order to make sure this doesn't occur, I need to optimize my memory usage. For example, I know that the maximum width of the iPad in portrait is 768 pts, and landscape is 1024 pts (discoverable via the width and height of a view's window). As such, I will only create/render my data when it is (or about to be) in view. This means I only have to render 0.1% of my total width at a time, which is a lot more manageable memory wise.
As to your specifc situation, the description is vague, and there isn't any code, so this is the best information I can give. In regards to the StreetScroller example (if I remember this is the WWDC sample project for UIScrollView), I don't know what issue you're having with that exactly.

Related

Setting widthUnit/heightUnit for a Sizeable object in Vaadin

For a sizeable object (https://vaadin.com/api/framework/7.7.3/com/vaadin/server/Sizeable.html), we obtain the width and height using getWidth() and getHeight() respectively, and the unit via getWidthUnit() and getHeightUnit(). How do I set the width/height unit?
EDIT:
So, the reason I ask is because I have a Panel and I'm working on a function that automatically scrolls it to a certain line. The Scrollable interface only provides setScrollTop in terms of pixels, so I would want to do something like:
panel.setScrollTop(lineNumber/totalLines * heightOfPanelInPixels)
For that, I'm planning on using the SizeReporter addon to give me "heightOfPanelInPixels", but I'm not sure I can guarantee the height being in terms of pixels. If it's not, I would need some way to convert the units.
Also, I asked about setting the unit since I thought it was just a universal thing: like if I could just set the unit for all Sizeables to report in, say, inches or pixels
There isn't really any way of achieving what you want to do, short of setting all sizes as px values from the server. For any other kind of size definition, the actual size in pixels will vary depending on lots of different factors that only the browser keeps track of. Furthermore, there isn't any mechanism that would pass back the actual sizes to the server as they are resolved.
You might want try this add-on that makes the size of selected components available on the server: https://vaadin.com/directory/component/sizereporter.
Old answer below:
There are two ways of setting the size in either direction. They both lead to exactly the same end result - it's just two different ways of expressing the same intent.
Taking the height as an example, there's the setHeight(String) method that expects a CSS definition such as 20px or 3.5em. This method is convenient to use of you want to set a hardcoded size directly from code.
The other approach splits up the size into a numerical size and a separate unit: setHeight(float, Unit), e.g. setHeight(20, Unit.PX). This method is more practical if you want to do calculations with the size, e.g. doubling it by using setHeight(2 * getHeight(), getHeightUnit()).
Setting and getting widths also work in exactly the same way.

Building for multiple screen sizes without size classes

I am currently writing an iPhone app (my first one) and never used
Size Classes
Auto Layout
Stack Views
To set the views/images/labels etc. on the screen. didn't use storyboard as well,
Every thing that is shown is coded.
I didn't start using these tools because back at the time (a couple of months ago) they seemed to be more of a pain than a true gain for my development process,
But looking back i feel i made a mistake and now I'm way too deep in code to start it all over again with the traditional/designated tools.
So, Having said that, are there any known frameworks and/or best practices to make sure that all that's printed are scaled exactly the same and have relevant ratio for each device size?
Something like: calculating the height/width ratio and somehow applying it to all the views/images etc?
is there any good way to get out of this mess?

Change Size of Game in XNA

I don't know a better way to say this, but I'm not looking to change the size of the window. I'm creating a maze, whose size that can be changed via scripting. As such, that may make the maze bigger what the window shows (even on full screen. Is there a way to shrink/enlarge the actual game inside the window?
Well, what you're asking is generally just a bad user experience, cause the size of the game will change, if the maze changes size.
That being said, what you're asking is technically possible. The way to do it would be to use a matrix for SpriteBatch.Begin's last parameter.
This matrix would look something like
Matrix.CreateScale(windowWidth / gameContentTotalWidth, windowHeight / gameContentTotalHeight, 1);
This will scale your game content to always be drawn within the screen. However this means if you make a large maze, you're likely to end up being unable to navigate it, cause you'd be having troubles seeing where you're going.

UICollectionView low frame rate

I have a collection view that displays 3 images, two labels, and 1 attributed string(strings are of different colors and font sizes and values are not unique for every cell). One of the images is coming from the web and I used AFnetworking to do the downloading and caching. The collection view displays 15 cells simultaneously.
When I scroll I can only achieve 25 frames/sec.
Below are the things I did:
-Processing of data were done ahead and cached to objects
-Image and views are opaque
-Cells and views are reused
I have done all the optimizations I know but I can't achieve at least 55 frames/sec.
If you could share other techniques to speed up the re-use of cells.
I was even thinking of pre-rendering the subviews off screen and cache it somewhere but I am not sure how it is done.
When I run the app on the iPhone it is fast since it only shows at least four cells at a time.
The first thing you need to do is fire up instruments and find out if you're CPU-bound (computation or regular I/O is a bottleneck) or GPU-bound (the graphics card is struggling). . depending on which of these is the issue the solution varies.
Here's a video tutorial that shows how to do this (among other things) . . This one is from Sean Woodhouse # Itty Bitty Apps (they make the fine Reveal tool).
NB: In the context of performance tuning we usually talk about being I/O bound or CPU bound as separate concerns, however I've grouped them together here meaning "due to either slow computation or I/O data is not getting to the graphics card fast enough". . if this is indeed the problem, then the next step is to find out whether it is indeed related to waiting on I/O or the CPU is maxed-out.
Instruments can be really confusing at first, but the above videos helped me to harness its power.
And here's another great tutorial from Anthony Egerton.
What is the size of the image that you use?
One of the optimization technique which would work is that
Resize the image so that it matches the size of the view you are displaying.

Rendering of a vast grid in a Scrollview container without CATiledLayer?

I'm looking for any advice on ways to have a rather large scrollview (let's say 8192x8192) which is essentially a grid and it has subviews of about 5-100 buttons placed in it.
The brute force approach runs out of memory as CALayer seems to be allocating a bitmap for the size of the scrollview's content (the memory issue is especially prominent when zooming is used)
I next added CATiledLayer to it, that's fixed the memory issue but there is a blurry effect on the grid as tiles are generated asynchronously and is still not ideal in that it's using a lot of memory for what is essentially a trivial 'draw some lines' task.
It seems like if I could somehow get control to draw my own grid via OpenGL each frame and tell UIKit not to create a bitmap buffer for the scrollview it would be perfect but not sure if this is feasible or even the right approach?
On Android I just took control of the entire drawing/zooming/panning but this seems vastly overkill on iOS which seems to offer most of this already?
You should check out the WWDC 2009 video session 102: "Mastering iPhone Scroll Views" along with the ScrollViewSuite sample project from Apple. They explain how to do a tiled scroll view with different zoom levels, which sounds like it is what you need.

Resources