iOS border in UIProgressView - ios

is there any way to add border around UIProgressView in iOS7? I dont find any property in storyboard. I've try do it like that also:
progressView.layer.borderWidth = 0.07;
but it gives me only border on top and bottom of progressView but not on the sides.

Consider adding your progress view as the subview of another view, where the container view has a border, or a background colour as required.

Related

Why is my viewController background color permanently white?

If I change the background color and run the app the color works fine, but as soon as I add subViews like a tableView or a containerView the still visible parts of the background becomes white.
I have tried:
- To set the color programatically. Still white.
- To add another UIView on the superView, add the subViews to that and changed the color on the UIView instead. Still white.
- While on the same approach as above, changed the superView color and set the UIView color to clear. Still white.
- Changed the alpha value to 0, but this makes the subViews invisible as well.
This is the hierarchy:
Have never run into this problem before and I don't understand it...
Check every outlet in storyborad if it has a background color of white . Or self.view.backgroundcolor to clearcolor may work , There must be a view under the view which color is white. Or sometimes there needs time to load the storyboard and this causes some undefined behaviour.You can try a dispatch_time_after in viewdidLoad and then start your code from there.

In Swift, how to customize the more menu on a tab bar?

I'm trying to change the back ground and size of the cells but on the more menu but am not sure how to do so. Here is what it looks like now:
I want to add a ui image as a backgrounds as well as add a ui image as a background to each cell so it will look like this:
I saw an old post about this on Stack Overflow but it was 7 years old. Does anyone know how to change the more menu in Swift?
In storyboard
1) add a uiImageView to the ViewControll or TableViewControll that you are using. set Constraint UImageView to SuperView as equal width,equal length,central horizontally and central vertically.
set outlet to access.
2) set tableview background to clear colour in attribute property
3)in tableview cell add a UIImageView and set the same equal width, length ,central horizontal and central vertical to contentView.
cell.background colour should be clear .
based on tab you should change the background image in tableview cell imageView in cellforIndexMethod.
you can change the background image of mainBackground in viewDidLoad or viewDidAppear based on the tab

Hiding and showing UILabel with rounded corner and shadow in Swift 2

I am using this method Swift - Problems with corner radius and drop shadow to add rounded corners and shadow to a UILabel.
However, I need to hide and unhide the label depending on content. I am setting hidden true/false in my ViewController class. But the shadow layer still shows.
See example images below.
What is the best way to hide/unhide this shadow layer as well?
Set the alpha to 0:
myLabel.alpha = 0

How can I change the background color of the footer of my UITableView inside UIViewController?

Sorry, I can't post picture here due to reputation.
The footer of the tableview inside a normal UIViewController is white color(default) but the whole Tableview is a gray color and this causes a strange look.
If I remove the Bounce Vertical, the white area will not appear anymore. But that means I cannot use pull to refresh.
So, I would like to know, how can I change the color of the white area?
Please try to modify the backgroundColor of your tableview or its superview (that is controller's self.view if you add the tableview as controller.view's subview), or you can just implement viewForFooterInSection: to customize a footer view. I found there is not a default color if you have not set a footer.

Missing shadow (hairline) on iOS7 UIToolbar

In iOS7, UIToolbar does not appear to have a little line (the shadow) on the top or bottom borders, which makes it difficult to distinguish from the rest of the app. How can I restore the shadow at the bottom of the toolbar when it is at the top of the screen?
EDIT: I should clarify that my toolbar is positioned at the top of the screen. After moving things around I realized that it IS drawing a shadow, but it's on the top, and therefore off-screen. What I want is for the shadow to appear at the bottom like a UINavigationBar.
This is because, by default, toolbars are attached to bottom, so the shadow line appears at the top (if they are at the bottom). You need to set the delegate of the toolbar and implement the following UIBarPositioningDelegate method like so:
- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar
{
return UIBarPositionTop; //or UIBarPositionTopAttached
}
I just ran into a case where a view was positioned between a top and bottom toolbar and configured to auto-resize to fill the space. However, it was layered above the bottom toolbar and the auto-resize made it cover the bottom toolbar's top shadow. The solution was to adjust the layering in Interface Builder so the toolbars were layered above the other views.

Resources