Any ideas for realizing this "feature"? [closed] - ios

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm currently developing an iOS app for my company and I'm really new to app development. I have a styling guideline from our companys' art agency.
Here is an example of what I'm trying to accomplish.
As you can see on the pictures' bottom there a some "stacked" / "overlapped" panels (where the arrow is pointing at) The first one should have a title and content - the other two just an title. There should be no functionality (just by touching on them as a whole, to navigate to the detail view) - but I have no clue for realizing this.
I had a look at UIStackView but im not sure if this is the right control for doing this.
Is there a control for doing this, or do i have to place those views manually?

If you truly don't need any other functionality other than tapping on them you're going to have to layout three UIViews yourself like you see in the picture.
It looks like the top one is a UIView with room for a title Label, a time label (maybe?), and a detail Label. So start with a UIView, create your labels, and add them in one by one to the top view, taking care to set AutoLayout up correctly so the views are aligned like you see.
I would reccommend creating the back UIView first, then adding it, create the middle one, add it, then create the last one and add it. This way they will automatically be setup in the correct order "depth" wise
Edit: As you said your new, let met me add one more tip on how to implement this - I would put the layout of the three UIViews and text into a separate UIView subclass. Then, you can simply instantiate an instance of that UIView subclass and place it where you need in your layout like you would any other type of view or control.
Basically, by making your own subclasss, you create your own control that you were looking for originally.

Related

How to customize a UITableview's index look? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
http://imgur.com/rxVYsV2 - reddit's index
I want to create an index similar to the one in reddit's app, especially adding icons to it and having it highlight the letter(see link for picture).
Any suggestions for how to do it(in xamarin ios)?
Since, you didn't ask for code, I'll just help you get started. :)
Use a UITableView to create a row, a cell would be like
Add another UITableView to create the side listing, with just an alphabet as cell. Something like
Now, on selection of any row from the second UITableView, modify the highlight and scroll the left UITableView accordingly. As well as on scroll of left TableView, change the highlight according to the first alphabet.
UPDATE
For StoryBoards follow the following steps:
Drag and drop two UITableViews in StoryBoard, place and resize them however you want (according to the layout you want), apply constraints.
Give each StoryBoard a reference like you do for other elements such as buttons etc. or give them a Tag.
In your ViewController make two Nested Classes, two of them for 1st TableView, one inheriting from UITableViewDataSource and other from UITableViewDelegate. Override the mandatory methods (link).
Now once you have the classes done, assign them to your TableViews like
//With Tag
UITableView myTableView1 = (UITableView) this.View.ViewWithTag(1);
myTableView1.DataSource = new MyTableView1DataSourceClass();
//OR
//With reference
myTableView1.DataSource = new MyTableView1DataSourceClass();
myTableView1.Delegate = new MyTableView1DelegateClass();
Please look at Create UI Objects for more help with making objects.
Please upvote and mark it as the correct answer if you feel it is. Besides, let me know if you need more help. Have a great time coding :)

How to let a user duplicate a view [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've a countdown app, it counts the time towards and since a date that the user chooses, and would like to know how to allow a user to pick more than one countdowns.
I'm thinking if there is a way to let the user duplicate the view, but I could be far from right, I'm new to this.
Any help would be much appreciated.
Thanks.
Given the requirements that you mention on your question and the follow up comments, I think perhaps the best is to use a horizontally scrolling collection view, with each cell taking up the whole screen.
(before the advent of autolayout, I would have recommended a UISCrollView with the content size varying at runtime as you add pages, but setting up UISCrollView correctly with autolayout is a steep learning curve. UICollectionView and UITableView take care of this for you behind the scenes).
The setup would be like this:
In the storyboard, embed your view controller in a navigation controller, so you can (perhaps) have your "Add Countdown" button as the navigation bar's right bar button item.
Next (still in the storyboard), add a collection view to your view controller and wire any outlets/delegates/etc.
Implement your data source so that it reflects how many countdown objects you currently have, and set up the "add" button so that when tapped, it creates a new counter and refreshes the collection view.

IOS how do i make a collapsable menu like this? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Hi there. Im new to ios, and i've been giving this assignment. I need to make a expandable/collapsable menu that can hold controls.
I have no idea on how to achieve this, and searching the internet has not proven fruitful - except for some navigation dropdown menus like this:
https://github.com/nmattisson/DropdownMenu
which is very nice, but ment for navigation, as i see it..
Any ideas? Thanks in advance
EDITED: Apparently the question was to broad.. I'll try to elaborate.
I need a menu i can place in certain viewcontrollers - each different viewcontroller can have different options, and often many different options. Therefore i need to add a menu that can be collapsed/expanded by a touch on the arrowbutton - as illustrated on pictures, and the collapsable menu must be able to contain different controls, depending on the context of where it is used.
After more research, i'm thinking a the usage of a container might be a part of the solution, and some animation to handle the expand/collapse.
So basicly - the menu could be something like the equivilant of an Android fragment, that can be inserted in the activities needed.
I hope this makes more sense.
You will try to play with Autolayout constraints ,
Ex : The height constraint of the container view is 60 in expanded mode ,if you want to collapse it change it to 0.

Tricky transition in custom view [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Good day everyone!
A customer asked me to implement a view. Here you can download and look at video how this view should work. (Left cells are days, right - hours)
It's kind of calendar view.
I've tried to do this task with collection view and custom layout. But do not hit much success. Because of the tricky transition of left cells. They become smaller (to speed up scroll), but right side is still the same.
Is there any possibilities to create such transition in collection view or picker view? Or should i use base view with overriding draw method?
Regards, Eugene.
It's a calendar, so it's essentially infinite, so I don't think a UICollectionView or UITableView is appropriate for this (e.g. what would you return as the number of cells?).
I'd be creating custom UIView subclasses for the left and right side, and overriding drawRect.

When to create a view via a xib and when to create a view via code? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
The question is simple, I guess.
I'm looking for general rules of thumb.
I was even wondering if it's possible to create a view controller with a view described in code, but designed in a xib. (Makes sense?)
Closing the question
Although #mckeejm gave an answer where he thinks he had no choice but using code instead of a xib, the question hardly has only one correct answer and it is also very hard for one person to give a response with all the possible correct answers in it, therefore I'm voting to close my question.
But thanks anyway.
One thing you can do when you create views without a .xib file is have views that are derived classes of other custom views. For example, in the application I'm working on now, we have the concept of "cards" where cards have a corner radius and shadow setup prior, with a plain UIView *contentView for the actual content of the card to be placed in. If we want to make a new card, without reproducing that code, we simply create a new class that inherits from CardView and then manually position its content via layoutSubviews. I personally like having a .xib for constraint positioning and things like that, but I couldn't find a way to use our CardView as a base class for the new card style control unless we did it programatically.
Yeah what you can do is make a UIViewController in the storyboard file and connect that to a UIViewController class of your choice. Make the basic design in the builder then in the code you can go through and "customize" it to your need. I.e: when a button is pressed change an image. Does that answer your question?
#crimsonchris is right, this question is too open.
I will say this though: I've built apps that utilize storyboards, xibs, and flat out code. I've always found that writing things out in code is simply the fastest, most lightweight solution. BUT it has to be done correctly. My particular method to get ahead is by subclassing.
Typically, you have a consistent style guide in your app and can reuse a lot of ui elements throughout your app. The downside to writing everything in code is that it requires so much redefinition of object's attributes (font, text color, etc). If you subclass a baselined ui class of say a UITableViewCell you can use it everywhere and don't have to deal with the xib/storyboard nightmare. Not to mention the massive speed difference...
If you are a member of linkedIn, there is an IOS developer group that you can join that is probably more appropriate for questions of this type (coding styles). In the linkedIn group the discussion for this same question is already several pages long.
Personally, I use the XIB for its basic layout capability so I can visually gauge if the view looks good or not. Interface builder is not always an answer specially if you have dynamic screens with several layers - in which case I sometimes use a temp IB just to get the coordinates but build the view via code. Take note:when you use a XIB, the objects in the screens are instantiated by the XIB and is a black box to you - so if I have dynamic views with several objects that appear conditionally, using a XIB will create all those objects before your viewDidload whether or not those objects are eventually useful or not. Necessarily it will affect the way you debug, specially if the problem originates from within the XIB.
storyboards allow you to prototype without typing any code, which means you can show your boss how the app should look like within a few hours, I find it limiting in the way I am able to pass values and embedded class instances between class to class so I hardly use it. It is extremely useful if you can work within its boundaries.

Resources