WatchKit UIPageControl Dot Colour - ios

When I was watching one of the videos from Apple about the Apple Watch and its features I noticed that the page indicator dot colours change depending on the page presented.
They've also got images of the coloured dots within the Apple Watch Human Interface Guidelines App Anatomy section. Note the coloured title text as well.
Normally in WatchKit I would use the following snippet of code to do this:
let features = ["First", "Second", "Third"]
let controllers = [String](count: features.count, repeatedValue: "FeatureInterfaceController")
self.presentControllerWithNames(controllers, contexts: features)
Unfortunately as far as I know there isn't a way to access the currentPageIndicatorTintColor and pageIndicatorTintColor as you normally would as part of UIKit here (scroll down to Tint Color).
I wonder if Apple simply just added those colours for the video or whether they're actually going to be available as part of WatchKit in the future?
Perhaps I'm wrong and there is a way to change these dot colours.

As written by an Apple Engineer in the Dev Forums, it's not possible to customize the color of the page control at this time.
Source: https://devforums.apple.com/message/1100695#1100695

Related

List with system background color gets messed up in dark mode

I am trying to set a background color for a List that will adapt to the iOS mode (light/dark).
I use .systemGray5 without problems in VStacks but when using it in Lists and I change to dark mode I get a very dark, almost black color which makes everything unintelligible.
This happens regardless if the list is dynamic or static. Is this a bug? Or is there an alternative way to do it?
List {
Text("Privacy").foregroundColor(Color(.systemRed))
}.colorMultiply(Color(.systemGray5))
The problem is that colorMultiply will multiply all colors in the list (text, background, separator) with the given color (see multiply color blending). This will darken the whole view, which probably looks okayish in light mode, but is the opposite of what you want to do in dark mode.
There are two ways to change the background colors in a List:
List {
Text("Privacy").foregroundColor(Color(.systemRed))
.listRowBackground(Color(.systemGray5))
}
.background(Color(.systemGray5))
background will change the background of the whole List, but I guess this is only really visible in grouped lists, since the cells usually don't have any space between them.
listRowBackground changes the background color of a view when it's used in a List environment. That's probably what you want to use here.
Frank Schlegel provided an answer which works only for static lists. Until Apple fixes this for dynamic lists I solved my problem by using this code
List {
ForEach(pumpData) { pump in
Text("pump").listRowBackground(Color(.systemGray5))
}
}.background(Color(.systemGray5))
.secondarySystemGroupedBackground worked for me.

Is it possible to change color of bottom horizontal line of iPhone X series within app?

is it possible to change color of bottom horizontal line of iPhone X series within app(inside app only)? my client is asking to change color of this line, and i am not able to find any related topic or solution.
Thanks.
No, I don't think it is. That's drawn by the system, and is not part of your app. Apple does not let apps change things outside of that app's "sandbox".
Edit:
I found a long article on the subject online:
https://medium.freecodecamp.org/reverse-engineering-the-iphone-x-home-indicator-color-a4c112f84d34
It seems it's called the "home indicator" and this author supports my suspicion that you can't change its color.
Edit #2
As Matt points out, the color of the home indicator changes automatically. The system has logic in it that tries to keep enough contrast between the home indicator and the area around it so that it's clearly visible. See the article I linked for more on that subject than you probably wanted to know.
You can only remove it:
override var prefersHomeIndicatorAutoHidden: Bool {
return true
}
The color is applied automatically.

How do I change the color of the push notification icon in flutter? [duplicate]

I tried making the small icon exactly 16x16, gray-scaled, nothing but gray and white (the gray color being hex value 616161), to create a silhouette of my application icon.
Yet no matter what it just shows up as a white/gray square in the notifications. What am I doing wrong?
(My min api is 21, assuming it is relevant)
Follow this link
First let’s understand the Android documentation which is as follows
“Update or remove assets that involve color. The system ignores all
non-alpha channels in action icons and in the main notification icon.
You should assume that these icons will be alpha-only. The system
draws notification icons in white and action icons in dark gray.”
Now this is easy to miss and I have seen many apps that are live in the app store with thousands of users who haven’t followed the mentioned guidelines.
So let me explain in detail how you can convert your notification icon to an Android friendly one with a few clicks.
In your favourite image editor open up your icon file. Convert all parts of the image that you don’t want to show to transparent pixels. All colors and non transparent pixels are displayed in white. Let us go through an example.
EDITED: Thanks #Andrey Patseiko for the tool
For notification you have to use different icons for different versions of android:
Notification notification = new Notification.Builder(context)
.setAutoCancel(true)
.setContentTitle("My notification")
.setContentText("Look, white in Lollipop, else color!")
.setSmallIcon(getNotificationIcon())
.build();
return notification;
Get notification icon on the basis of version
private int getNotificationIcon() {
boolean useWhiteIcon = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP);
return useWhiteIcon ? R.drawable.icon_silhouette : R.drawable.ic_launcher;
}
Along with new features and capabilities, Android 5.0 includes a variety of system changes and API behavior changes. See the notification behavior changes.
Notifications are drawn with dark text atop white (or very light)
backgrounds to match the new material design widgets. Make sure that
all your notifications look right with the new color scheme. If your
notifications look wrong, fix them:
Use setColor() to set an accent color in a circle behind your icon image.
Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon.
You should assume that these icons will be alpha-only. The system
draws notification icons in white and action icons in dark gray.
So, basically you have to use silhouette icons as notification icon for API Level 21+

How to change Apple Map (MKMapView) background colors?

I've Required an iOS application with a black theme, and would really like to make the displayed Apple Map also in black colors.
I see nothing in the native documentation that talks about changing look for MKMapView.
I've Googled the topic and tried to change MKOverlayView.But, I couldn't find anything.
Is this even possible? Can I change the background colors of the Apple Map.
Thank you.
You can customize map using MapBoxKit
https://www.mapbox.com/ios-sdk/api/3.6.4/runtime-styling.html
In Mapkit you can only set dark mode as hybrid as follow:
in viewDidLoad write below code:-
mapView.mapType = .Hybrid
Need to add Privacy - Photo Library Usage Description in info.plist
also you can set from IB as above:-

iOS Apple Pay - Customize PKPaymentButton

I'm using PKPaymentButton for ApplePay integration but want to know if I can customize it easily.
let applePayButton = PKPaymentButton(type: PKPaymentButtonType.setUp, style: PKPaymentButtonStyle.black)
Can we change the button style?
After setup of ApplePay, I wanted to change the buttonType to .buy but didn't find a solution.
Can we remove corner radius?
Default ApplePay button has corner radius. I don't like it and tried to remove it. So, I tried to work with layer but it didn't work.
applePayButton.layer.cornerRadius = 0
Please let me know if I can change the ApplePay button properties easily.
Yes you can change it by recreating PKPaymentButton with different PKPaymentButtonStyle in runtime. Or you can write your own PKPaymentButton wrapper that will do it for you.
Though Apple doesn't recommend to alter Apple Pay Button appearance, it's doable. Again, using your PKPaymentButton wrapper, place Apple Pay button in the center and alter corner radius of your wrapper button, you can change size of icons in that way too. I did it in some of my projects and didn't get a word from Apple.
You can also change the appearance of the button with his runtime attributes:
[self.applePayButton setValue:#(0) forKey:#"style"];
Pass 0 for a black button and 2 for a white Apple Pay Button
In the Apple Pay Identity Guidelines, Apple states that you should not change the corner radius of the Apple Pay button (PKPaymentButton).

Resources