I have weird problem on iOS 8 with dynamically resizing table cells.
While I scroll down table, cells which come in and appear seems to fly in. It looks like cell adjust width to fit iPhone 6 (like stretching from wider size).
How to prevent that strange behaviour.
read and learn about reuseIndetifier, it will speed up cell rendering and a must to use. And post code next time :)
iPhone - What are reuseIdentifiers (UITableViewCell)?
Definitely I know how to use reuseIdentifier and I do it.
Problem is completely different, maybe someone else met that kind of issue.
Related
I'm creating a report for MS Dynamics AX using SSRS. So far everything is working well, but this time i'm making a report consisting of many tablixes. Row height is fixed and there seem to be no issues from a horizontal perspective. Vertically however there is problem because columns are resizing randomly and my tablixes dont appear uniform. Everything appears perfect in design view but not in the output. Columns resize at run time. I have set the canGrow properties to false and resized all the columns manually but to no effect.
I've attached screenshots of my design and a small part of the preview/output.
Design
Preview
Has anybody faced such an issue? Were they able to solve it?
I had a similar issue where I needed the cell to be 3.5 in, regardless of the data within it. The fix wound up being to set the padding in the blank cell to that width.
I have an app that displays properly in portrait view but truncates in landscape view:
From the research I have done it looks like I need to understand Size Classes and Adaptive Layout. However, I am only concerned with layout on iPhone 6, not across different devices (eg iPad).
Before jumping into Adaptive Layout and Size Classes, which seems quite a complex topic, I just wanted to ask if there is a simple way to make this app display properly in both portrait and landscape for iPhone 6.
Thanks in advance!
Yes, you can do it without size classes, but it requires a reasonable modification to your UI.
If you think about it then having a picker always visible makes no sense for you. Looking at your image I am puzzled as to which date is currently being adjusted.
What you want to do instead, is to make your picker appear after user clicks on one of the dates. You can make it slide up from the bottom. In addition, you can add a label above it which will clearly indicate which date the user is currently modifying. That label can be placed in the toolbar to make it easy to add "Done" and "Cancel" buttons to the left and to the right.
In my view it would make much more sense and would also solve your problem. The rest of the UI can be put in the scroll view if you don't have enough space on old devices (e.g. 3.5 inch iPhones)
Can anyone help with a problem with UIPageViewController giving transparent page backs?
I have a project displaying mock-ups of old newspapers. I am setting double sided to true and have slightly blurred and mirrored images for the page backs.
One prototype version is okay and looks like this as a page turns:
However, an updated version with different background looks like this:
As you can see, the curled page back is now completely transparent.
I think the code is the same in each case although the UIView hierarchy is different.
Can anyone help me out by explaining what might be the cause?
Many thanks!
This problem appears to be due to the fact that I had a sublayertransform in place that was not the Identity matrix. Resetting before using UIPageViewController fixes it.
let noPerspective = CATransform3DIdentity
self.view.layer.sublayerTransform = self.noPerspective
This clearly interfered with UIPageViewController's animation.
I'm trying to figure out how can I solve a problem.
Basically I have a Dynamic TableView, with dynamic Images(Different Sizes).
I want to set always a fixed width:320 for the UIImage and use the Mode: Aspect Fill(Without Clip Subviews), the image maintains the width and set the height dynamically based on my width, but the problem is, my image cover up everything else, like labels, buttons and edges of my cells, I tried to use auto-layout with constraints to reposition these other components(labels,buttons,etc), but not worked.
I don't know if just using the Interface Builder I can solve this behavior or I need to check/calculate some information programmatically.
Any ideas are welcome.
Thanks Team!
Due to lacking of your code as example, I can just suggest you use a swift library from GitHub called Toucan. Toucan is a Swift library that provides a clean, quick API for processing images. And it solve my image problem smoothly.
You should be able to solve this in Interface Builder.
I usually am always able to accomplish my desired layout using constraints and priorities. Only in cases with dynamic type it gets difficult.
I don't know the layout of your cell. It would be helpful if you would post a screenshot of your cell and indicate where the overlap occurs.
I'm trying to adopt the adaptive layout in a new app and have learned quite a bit. For the last portion I had to dump text into a table and have the cells adjust to stay adaptive, seemed easy enough.
I read through a few tutorials and for iOS 8 it looks like it just comes down to two things:
Having estimatedRowHeight and rowHeight = UITableViewAutomaticDimension set
Having constraints set up right to create pressure on the cell itself
Shamefully my entire day has gone out the window trying to master those mere two points... I downloaded code provided from Keith Harrison on self sizing table view cells to see it work. I duplicated his cell into my larger project and it worked, however none of my own cells worked. I deconstructed everything in his project and minimized it to the point where little is left then tried making a similar cell from scratch. I've gone through and verified every constraint, every hugging/resistance setting, etc, and yet mine fail to expand the cell height.
If anyone can point out what I'm doing wrong (and it must be tiny because everything I see is the same) I have uploaded a minimized version of his example here (GitHub).
With this example I tried a cell with a single multiline label with constraints all around along with a cell as close as possible to his cell. I found that in many of my attempts everything looked identical however I would get a UIView-Encapsulated-Layout-Height constraint issue. With my last attempt I reduced the priority of the vertical spacing to the content container to 999 from 1000.
Things I have checked or tried with no effect:
Contraints are to superview (content container, not cell)
Label is set to 0 lines
Hugging and Resistance priorities the same as working cells
Reloading table once loaded
I have my solution working now after another long stab at it. Two things:
The UITableViewCells, while identical in every way in the storyboard had a rect tag within the storyboard source with a defined width and height. I looked everywhere for the values in IB with no luck. Taking that out fixed my problem for the GitHub test project I posted.
After moving over to the project I was initially working on the cells still were not resizing, but would when orientation was changed. I had to add a cellForRowAtIndexPath method to call setNeedsDisplay and layoutIfNeeded on the cell being requested.
Following the above everything appears to be working.