Comments (2)
Perhaps UIAlertView
doesn't appear in the app's list of UIWindow
s?. If this is the case, I'm not sure if there's a way of dealing with it.
As for displaying an overlay over the keyboard, you'll have to make an alteration to the delegate method writeBackgroundFrameInContext:
(or create a new delegate method writeOverlayFrameInContext
).
A quick hack would be to change the following lines in the .m
file:
if (self.delegate) {
[self.delegate writeBackgroundFrameInContext:&bitmapContext];
}
// draw each window into the context (other windows include UIKeyboard, UIAlert)
// FIX: UIKeyboard is currently only rendered correctly in portrait orientation
dispatch_sync(dispatch_get_main_queue(), ^{
UIGraphicsPushContext(bitmapContext); {
for (UIWindow *window in [[UIApplication sharedApplication] windows]) {
[window drawViewHierarchyInRect:CGRectMake(0, 0, _viewSize.width, _viewSize.height) afterScreenUpdates:NO];
}
} UIGraphicsPopContext();
});
to:
// draw each window into the context (other windows include UIKeyboard, UIAlert)
// FIX: UIKeyboard is currently only rendered correctly in portrait orientation
dispatch_sync(dispatch_get_main_queue(), ^{
UIGraphicsPushContext(bitmapContext); {
for (UIWindow *window in [[UIApplication sharedApplication] windows]) {
[window drawViewHierarchyInRect:CGRectMake(0, 0, _viewSize.width, _viewSize.height) afterScreenUpdates:NO];
}
} UIGraphicsPopContext();
});
if (self.delegate) {
[self.delegate writeBackgroundFrameInContext:&bitmapContext];
}
The delegate drawing will now occur on top of the app window (for my use case I needed to draw live video and overlay the app controls over the video, that's why the delegate draws beneath the app window by default).
Then in your view controller, implement the delegate method [ASScreenRecorder sharedInstance].delegate = self;
:
- (void)writeBackgroundFrameInContext:(CGContextRef*)contextRef {
// create overlay CGRect
CGRect overlayRect = …
// set overlay color
CGContextSetFillColor(contextRef, …
// fill rect with overlay color in `contextRef`
CGContextFillRect(contextRef, overlayRect)
}
from asscreenrecorder.
Thank you so much for the quick answer !
The solution with overlay works perfectly !
The one for UIAlertView didn't had time to test, will come back with an reply to that also in a couple of days.
from asscreenrecorder.
Related Issues (20)
- How to record particular view only ? HOT 1
- Urgent Help: Black video on iOS9? HOT 1
- how to add Audio ? HOT 1
- Warning: Unable to write buffer to video HOT 1
- Not working properly HOT 1
- Appstore? HOT 1
- [FPS] How change FPS of the video to 60/1? HOT 4
- In background Mode HOT 1
- Recored only Subview HOT 1
- After once record,Twice will be crash. HOT 1
- How to Capture AVCaptureVideoPreviewLayer? (camera.previewlayer) HOT 4
- Carsh on my iPhone HOT 1
- cpu very high HOT 4
- record half size resolution for retina iPads????
- unable to capture the camera preview layer HOT 8
- Unable to record youtube full screen video
- Unable to build on Swift 5
- FPS HOT 12
- Possible to include video from AVPlayer? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asscreenrecorder.