Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the space used by the battery icon on the iPhone?

Tags:

iphone

I noticed that this iPhone app Reeder has a special icon on top of the battery icon. How is this done? It even does animation in that corner so I assume you can just lay an UIView on top of the battery?

Also a side question, how do you overlay a texture on top of NavBar and the bottom Toolbar? Noticed how the bars are not exactly black, it has a texture on it.

alt text http://img689.imageshack.us/img689/1224/photofo.jpg

like image 449
erotsppa Avatar asked Feb 08 '10 17:02

erotsppa


People also ask

How to show battery percentage on iPhone 13?

On iPhone 13 and other iPhone models with Face ID (iPhone X and later), the battery percentage appears in Control Center. Just swipe down from the top-right corner of your display. With iOS 16, you can turn on the battery percentage so it appears in your status bar.

How do I hide battery usage on iPhone?

Go to the Settings app from your home screen, choose General, Usage, and Battery Usage. Then decide to display or hide battery usage for each app.

How do I change the battery display on my iPhone 12?

Swipe down from the top right corner of the iPhone 12 screen to open iOS Control Center. In the top right corner of the screen, next to the battery icon, is the battery percentage. This is how much battery your iPhone 12 has left. Swipe up or tap on the background to close Control Center again.

How to show battery percentage on iPhone 11?

Open Settings on your iPhone. Scroll down and tap Battery. Toggle on Battery Percentage.


1 Answers

I would imagine that this app simply creates an UIWindow with it's windowLevel property set to some large value. By doing so, one can make a window appear to be part of the statusbar.

UIWindow *topWindow = [[UIWindow alloc] initWithFrame:CGRectMake(5.0f, 5.0f, 310.0f, 12.0f)];
[topWindow setBackgroundColor:[UIColor redColor]];
[topWindow setAlpha:0.5f];
[topWindow setWindowLevel:10000.0f];
[topWindow setHidden:NO];
like image 80
rpetrich Avatar answered Oct 06 '22 00:10

rpetrich