Hide Scrollbar in Cordova IOS App - ios

This is not work on my ios cordova app, I have tried many ways, but the scrollbar still appear.
::-webkit-scrollbar { display: none }
This article tell me to add 2 lines to CDVUIWebViewEngine.m file but I dont know where to paste these lines.
self.webView.scrollView.showsVerticalScrollIndicator = NO;
self.webView.scrollView.showsHorizontalScrollIndicator = NO;
I need a solution to hide scollbar entire my Cordova Ios App, please help me, thanks.

If you are using plugin cordova-plugin-ionic-webview, which is transfer your APP from using UIWebView to WKWebView. After build your APP.
find file platforms/ios/your_APP_name/Plugins/cordova-plugin-ionic-webview/CDVWKWebViewEngine.m;
find lines
wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:#"MinimumFontSize" defaultValue:0.0];
wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:#"AllowLinkPreview" defaultValue:NO];
wkWebView.scrollView.scrollEnabled = [settings cordovaBoolSettingForKey:#"ScrollEnabled" defaultValue:NO];
wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:#"AllowBackForwardNavigationGestures" defaultValue:NO];
insert the two lines under them.
wkWebView.scrollView.showsVerticalScrollIndicator = NO;
wkWebView.scrollView.showsHorizontalScrollIndicator = NO;
It works on iOS 13.

Related

Unable to remove extra margin in BarChart (Charts)

One of my app using Charts library for drawing graphs.
Everything works fine but in BarChartView it's adding some default margin around the chart and I have done the below changes in the Chart property but still, it's not removing the margin around the graph.
I have also checked the same issue on this Question thread but no luck at all.
Check below screenshot for margin issue:
I have done the below changes for removing the margin around BarChart.
_barChartView.minOffset = 0;
_barChartView.xAxis.enabled = NO;
ChartYAxis *leftAxis = _barChartView.leftAxis;
leftAxis.drawGridLinesEnabled = NO;
_barChartView.leftAxis.enabled = NO;
_barChartView.leftAxis.drawAxisLineEnabled = NO;
_barChartView.rightAxis.enabled = NO;
_barChartView.rightAxis.drawAxisLineEnabled = NO;
_barChartView.legend.enabled = NO;
But still, I am not able to remove the margin.
Also checked Charts Demo app has the same issue while changing data from the slider.
Check Below screenshot from Chart Demo App:
Any help or hint appreciated :)
Hello I have checked in the demo of Charts library which you have provided.
Where i have added below code and it's work, check the screenshot below.
BarChartViewController.h
Add this code on line number : 115
_chartView.minOffset = 0;
_chartView.xAxis.enabled = NO;
_chartView.leftAxis.enabled = NO;
_chartView.leftAxis.drawAxisLineEnabled = NO;
_chartView.rightAxis.enabled = NO;
_chartView.rightAxis.drawAxisLineEnabled = NO;
_chartView.legend.enabled = NO;
let me know for more.
Here is the output of my simulator with blue background.
I know this is old but just for anyone who stumbles upon the question
This solved it for me
barChartView.leftAxis.axisMinimum = 0
barChartView.rightAxis.axisMinimum = 0

Conditional code for iOS class availability

I am trying to add conditional code to prevent "Symbol not found" errors on an iOS 7 device when using an iOS 8 class, in this case UIBlurEffect:
dyld: Symbol not found: _OBJC_CLASS_$_UIBlurEffect
Even though the code within the conditional does not run (I do not see the "UIBlurEffect will be used!" log statement), I still get the error. If I comment the block out, it runs fine.
BOOL blurAvailable = NSClassFromString(#"UIBlurEffect") ? YES : NO;
if (blurAvailable)
NSLog(#"UIBlurEffect available");
else
NSLog(#"UIBlurEffect not available");
if (navBarBlurBool && blurAvailable)
{
NSLog(#"UIBlurEffect will be used!");
if (![viewController.navigationController.navigationBar viewWithTag:BLUR_NAVBAR_TAG])
{
// Code works on iOS 7 if this block is commented out:
[self storeOriginalNavBarImages];
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
blur.frame = CGRectMake(0, -1 * statusBarFrame.size.height, self.navigationController.navigationBar.frame.size.width, self.navigationController.navigationBar.frame.size.height + statusBarFrame.size.height);
blur.userInteractionEnabled = NO;
blur.tag = BLUR_NAVBAR_TAG;
[self.navigationController.navigationBar insertSubview:blur atIndex:0];
}
}
I don't understand - I would assume that if blurAvailable is false then the offending code should not run and I should not get the "Symbol not found" runtime error.
I'm using iOS 9.2 SDK. Xcode 7.2. Deployment target is iOS 7.0.
Please make sure that blurAvailable is really NO on iOS 7.
Maybe the class is available on iOS 7 but not marked as such in the documentation. They might have introduced it in iOS 7 as a private class (just hiding it in the doc and headers).
Try testing another class marked as "unavailable on iOS 7" like UIVisualEffectView.
From a comment in this question, the answer is to add UIKit as an Optional dependency in "Build Phases" -> "Link Binary with Libraries". I can now run the conditional iOS 8 code without errors on the iOS 7 device.

XCUI testing, how to scroll to an element that is off screen in Xcode 7.1 Beta 3?

I'm attempting to automate a test that includes accessing an element that is initially off screen. I've tried the swipedown() method, among other things, and haven't been able to find a solution. I've seen posts saying that it should scroll down to an element when you attempt to tap it, but this is not working for me at the moment.
I can show Center Control by :
XCUIApplication *app = [[XCUIApplication alloc] init];
XCUICoordinate *from = [app coordinateWithNormalizedOffset:CGVectorMake(0.5, 0.99)];
XCUICoordinate *to = [app coordinateWithNormalizedOffset:CGVectorMake(0.5, 0.25)];
[from pressForDuration:0 thenDragToCoordinate:to];
you could try it.

OSM works on my iPhone but doesn't work at another

I run OpenStreetMap in my app:
NSString *template = #"http://tile.openstreetmap.org/{z}/{x}/{y}.png";
MKTileOverlay *overlay = [[MKTileOverlay alloc] initWithURLTemplate:template];
overlay.canReplaceMapContent = YES;
[self.mapView addOverlay:overlay level:MKOverlayLevelAboveLabels];
It works perfect in my iPhone with iOS 8.3, and customer before update iOS til 9.0 didn't say anything. But now, customer says hi has only grid instead map. Hi has iOS 9 now.
What changed? What should i add in my code?
HTTP, by default, is not supported in iOS 9, so your initWithURLTemplate call is failing. When the MKTileOverlay goes online to fetch a tile, it can't do it. Thus, no map appears.

UITableView background View nil doesn't work in iOS 5

I need to make my grouped UITableView backgroundColor transparent.
So i write following code. That is work in iOS 6. But in iOS 5, it doesn't work.
self.tbView.backgroundView = nil;
How to do that in iOS 5.
Are you setting [self.tbView setBackgroundColor:[UIColor clearColor]];?
If not, you need to add that or you won't get a transparent backgorund color.
You Need to put background Nil code into ViewDidLoad this is working fine in my Code. Hope this Helps you.
[tbl_My_Table setBackgroundView:nil];
[tbl_My_Table setBackgroundView:[[[UIView alloc] init] autorelease]];
I got it answer.
We need to add two lines of codes for both iOS 6 and iOS 5.
Here is codes.
self.tblPreferences.backgroundView = nil;
self.myTable.backgroundColor = [UIColor clearColor];
That is working both iOS 5 and 6.

Resources