How to disable selection of bar char? - ios

I have implemented a bar chart and I would like to move to a more specific on click on that bar chart. for that I am using "ChartViewDelegate(Chartviewselected)" it is working fine. but issue is first time when I select bar chart it goes smothly to next screen. but when come back on that screen selected bar shows selected default, when click on that bar again then it gets unselected. because of that chartview delegate(chartview selected) method not called. So I want to disable default selection of bar chart. is there any property to disable selection of bar chart?

Use dataSet.highlightEnabled = false

When coming back to the screen try calling:
lineview.delegate!.chartValueNothingSelected!(lineview)
According to ChartViewBase.swift:
// Called when nothing has been selected or an "un-select" has been made.
#objc optional func chartValueNothingSelected(_ chartView: ChartViewBase)

If you need to removed highlighted Bar while come back from Previous screen put below code in viewWillApper() it will remove highlighted Bar.
//Manyally Remove Selected Bar
[self.chartView highlightValues:NULL];
Hope this will helps!

Related

How to make Tab Bar Item disabled and how to change color and transparency for disabled Item

Is there a way to make chosen Tab Bar Item look disabled programmatically?
I have Tab Bar, almost everywhere its Items look active (it is delete, edit, search buttons). But on some pages some of its Items has to be inactive, showing user that he can't edit/delete anything here. I'm thinking, is there a way to change the visual appearance of chosen Tab Bar Item? Or better to use just set of the Buttons?
all active items/buttons in a bar, screenshot
all active items/buttons in the bar, screenshot
UPD: Desigion for disabling Item found, but when I make the Item disabled, I need to change its colour. Now it has the same color as UITabBar.appearance().unselectedItemTintColor but with transparency. Is there a way to change color and transparency for disabled Item (make it coloured differently and not transparent), keeping the colour for unselected Items?
For required tabbar item try to set false for .enabled property.
Obj-C
.enabled = NO;
Swift
.isEnabled = false
Alternatively, you could make your tabBar dynamic and instead of disabling/enabling, only show the relevant items. This way, the items are always nicely displayed and you don't have any gaps as you have in your screenshot.

UITabBar first item title overlapping

I'm using tabbar with four tabs with title. I'm setting different color for selected and unselected tabs. But only for the first tab, the selected and unselected colors & title are getting overlapped. Whenever I'm selecting first tab, title is getting added again and again. I have attached screenshot as well.
In storyboard
Anyhelp could be appreciated. Thanks in advance.
You problem is most likely from the color you use for unselectedItemTintColor, which you have set to have transparency. This color should probably be solid. Try changing it to a solid version of what you want to see, like #EB989E.
Also be aware that you are setting an internal property, and as such it may change or disappear in a future release of iOS.

Appcelerator ListView transparent row selection?

I've made an app (for iOS) that shows a ListView with product information on it.
On the left of the row, I have a button to add the product to the orderlist. However when I click the button, the entire row changes color. I don't want this, I want the row to stay the same when it is clicked.
I've tried to set the allowSelection property to 'false', but then the 'itemclick' event doesn't fire anymore, so that's not the solution.
I also tried to set the selectedBackgroundColor property to 'transparent', but this still changed the color of the row when the button is clicked.
Is there any easy solution to this? Thanks.
Use "selectionStyle" property of the cell class, example shown below,
cell.selectionStyle = .none
By this usage the selection will occur but it wont change the color on highlighting(selecting state) of the cell.

Disable back button text

I want to disable the back button text in Xamarin iOS,
along with the button itself. I already disabled the back button itself but the text is left.
Does anyone know of any way to disabling the text as well?
Thanks
You can accomplish this in two ways:
NavigationItem.SetHidesBackButton(true, false);
or
NavigationItem.BackBarButtonItem = null;
If you use the second solution, then you would have to recreate the button if you ever want to make it visible again.
With Navigation Page:-
NavigationPage.SetBackButtonTitle(this, ""); //Empty string as title
or hide the Back button with:
NavigationPage.SetHasBackButton(this, false);

Xcode - How to change place of Tab Bar Item

I want the Contact icon on the left, what is the easiest way to do this?
EDIT: I found a simple solution.. I just had to delete the link between my Tab Bar Controller and the Bookmark page, then reconnect it to set it as second icon (on the right). See image: prntscr.com/b0hucd
Drag and drop should work
You can drag the contacts bar Item to the left to rearrange its position from the Storyboard.
Try this code i used it to move the image in tabbar items to move vertically up.In this loop check that the index is 1 else it will move the bookmark icon also
for (UITabBarItem * item in tabBarController.tabBar.items) {
item.image=[item.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
item.imageInsets=UIEdgeInsetsMake(item.imageInsets.top, item.imageInsets.left+20, item.imageInsets.bottom, item.imageInsets.right-20);
}
Note: If it doesn't move the text let me know
UITabBar Class Reference
Check out the "items" property. (emphasis mine)
This property contains an array of UITabBarItem objects, each of which corresponds to a tab displayed by the tab bar. The order of the items in this property corresponds to the order of the items onscreen. You can use this property to access the items as needed.

Resources