What element to use for small background image on iOS [closed] - ios

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 9 years ago.
Improve this question
What UI element should I use for a background image in an iOS application? The image is quite small (98*51) and I'll need to put a small label and two buttons on top of it. I tried both using a label (but can't find where to change the dimension and I wasn't able to change it to the correct one using only the mouse) and an UIImageView. Any suggestions?

If you are using interface builder, there should be no problem using a UIImageView with the appropriate dimensions, then placing the label and buttons on top of it. You can access the size of any of the elements from the size inspector in the right panel (the icon looks like a little ruler).

Both ways that you tried should work. Your first approach sounds simpler to implement, but your second approach is more flexible.
Using your first approach, you can place the image behind the label using this the technique described in this answer, setting the dimensions of the entire label by setting its label.frame = CGMakeRect(x, y, 98, 51).
The UIImageView route should be rather straightforward, too. Just remember to set label's background to transparent, as described in this answer.

I'm not sure I fully understand your question but if you want a tiled background image the simple way is to use this:
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imagedNamed:#"myImage.png"]]];

Related

what should I use to show very large static content data ? UIView, UITableVIew or UITableViewCell? [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 5 years ago.
Improve this question
I want to show a large amount of content with images.
It is kind of blog which contains some information with pictures.
I don't have any API, I have to show/write data manually (Hard-coded).
So, which will be the correct way to achieve this?
UIView 2. UITableView 3. UITableViewCell
For example : Seen below image, this is the sample, same way I want to impelemt. It is just some view, it contain very large data. When you scroll it will display more details.
I would recommend using multiple UITableviewCell approach with core-text ability to render text as in the screenshots mentioned.
Also, I would like to highlight that UITableviewCell is having issues in calculating auto height provided NSAttributedStrings based rendering
I think it's suitable to use UITableview with 2 custom cell one for images and the other for text , remove it's separator style and prevent selection give the label 10 margin from all directions and set .lines property to 0 , also use attributedString to set different fonts , colors to a specific range inside the text of the label
Can use tableview with custom cells. As its row height will be dynamically handled so no need to do much more complex process and easy to build.
Use UIScrollView if the content will be static (e.g. header and content). Because using UITableView will be redundant.

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.

Any ideas for realizing this "feature"? [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'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.

How to create animation like Apple Music app [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 7 years ago.
Improve this question
Hi I want to create a view with lot of button in circle shape but want them arrange and animate like Apple music app as shown below, I can not post image you can view screenshot here one with red bubbles
I am not adding full code because there are number of things done, but here are the steps you can follow to create something similar.
You can create round button by setting there cornerRadius = height/2 provided both height and width are same, to make them scrollable add them in a scrollView and set contentSize of scrollView. You can add scaling animation to the each button i.e add CAKeyFrameAnimationfor key path transform.scale.y and transform.scale.x
We can also do this by using spritKit here is the component which do similar

Ios - is there a pattern or architecture for a screen with lots of text and paragraphs? [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
I have a screen that is supposed to have a few large sections of text, a few buttons on different places, and headings for every section which have different styles.
I can just cut and paste the text on the screen and make it a scroll view and be done with it, but I am wondering whether there is a pattern or a good practice way of creating such a screen that is perhaps more elegant than just dumping a bunch of text right on the page.
I am working with storyboards.
Thanks in advance for your advice.
I think using a storyboard and laying out the content is reasonable if there isn't too much there. (You can use a separate UIView and make it whatever height you want for layout purposes, then programmatically insert it into the scroll view.)
One alternative we often use for a "rich text"-like view is a UIWebView. (Though buttons in such a view are more of a pain.)

Resources