How to remove white bar beside segmented control - ios

I have two UISegmentedControls over a mapView.
You can see a white background on the right side of the second control, that I am not able to remove.
Any help is welcome.

To avoid the ugly white sharp corners you need to do this:
self.segmentControl.layer.cornerRadius = 5;
and then play with the segmented control width to avoid the white space on the right side. Just try to decrese/increase the size by 1 pt in steps until it disappears.

You can set the Background to default. The default background should be transparent.

Related

Set the background of UILabel to transparent black

I have a UILabel that whose background I want to set to black with alpha component so that this label can have a transparent black background.
In the storyboard when I set the background to the colour I want with an alpha component even the text of the label that is in white colour becomes lighter with the alpha component.
To overcome this problem I embedded the label in a UIView and even then the same problem persists.
How can I overcome this problem. Any help will be appreciated.
You can Do only With label make IBObject an write following line.
label.backgroundColor = UIColor.black.withAlphaComponent(0.4)
Instead of changing the alpha value, change the opacity of the label background color in storyboard.
For better understanding, I have taken an imageView and placed a label at the bottom of imageView and changed the background color of the label and textColor to white. At this stage you can't see the image behind the label.
Now, go to attributes inspector and select the label background color. There you can see the opacity and change it's value. Here I have made it 50%, you can change it to whatever you want between 0 to 100 until you get your desired transparency.
create the UIview with black background color and add the UIlabel inside the view and set the alpha to 0.5 of view . finally you get the black transparent, for e.g
if you need the label text in bold change the view hierarchy
place the UILabel fist then add the UIView.
Place the UILabelabove the UIView, not inside it.
Assume that we are talking about v1 the view that contains your label , if v1 is over another view that has bright colors then when your v1's alpha get lower your label white text color will become harder to see , the text color has nothing to do with the background alpha component , so you need to reconsider using the white color or the alpha component background or the view that is behind v1 make it darker that's all we can say

UIPageViewController Page Spacing + Background Color

I have a couple of UIViewControllers embedded in a UIPageViewController.
Since the bouncing of the UIPageViewController apparently can't be disabled without ugly hacks, I would like to change the color that appears in the background when bouncing.
I know I can set the backgroundColor with view.backgroundColor, but I would like to have a different color for the background and the little space (Page Spacing) between the VCs.
How can I for example set a blue color for the spacing and a white color for the background that appears when bouncing?
Thank you!

Setting UIViews layer.cornerRadius adds gray lines around the view

Both background and border color are set to white, there is no gray color in my code anywhere.
But when I set views cornerRadius I see two gray lines left and right from the view(sometimes up and down too, depending on the UIViews function)
Although when I set views backgroundColor to clear, lines disappear. Any reason for this to happen?
EDIT:
This only happens on iphone device, not on simulator, dont know why :/
Here I have one big white UView and 8 smaler ones inside it, and I am using constrains for the autolayout(but no problem there), and when I set all of these small views background color to clear, they disapear(also this big white view is responsible for the few of these gray lines)
And solution to the problem is either removing cornerRadius or seting background color to clear.

mysterious white antialiasing behind UIImageView

I'm using a PageViewController to swipe through a series of daily ViewControllers for a week.
The UIViewController that contains the pageViewController contains a few navigation items that do not scroll with the pageViewController. These stay stationary as you swipe. One of these items is a UIImageView, more specifically a UIButton with an UIImageView image representation.
The trouble I'm having is that this stationary UIImageView has a thin white border to it when it should not. I'm giving it a rounded appearance by using rounded corners that are the size of the image. It is easiest seen in this photo. Note, the white "halo" is not part of the image, it appears for any image. The borderColor, imageBackground, view background, and parent view backgrounds are all clearColor. The red background below is part of the swipeable viewController. Interestingly, the white border only appears when it is stationary. If the image/button is placed in the swipeable View it looks great.
Any thoughts how I can get rid of this white antialiasing?
I changed the button's image from using the backgroundImage to just the image property and the white went away entirely. Glad for an easy fix, hope this helps someone else.

Is there a way to set the background color in blackberry?

I would like to chnage the background color.. At first i tried to creat a vertical container, but this did not work becouse the edges wrapped arounbd the content, so there was a big right and left margin.
Ted
You could set the screen background by:
Background myBG = BackgroundFactory.createSolidBackground(Color.RED);
getMainManager().setBackground(myBG);

Resources