Can you point me out good documentation/practices for developing custom controls?
I checked the official doc, but it's not enough for me.
I would like to display a Label or a TextField and wrap it with a Path object to create a border.
Please find here a sample of what I want to create :
From top to bottom, left to right :
Label, Textfield,
Label, Passwordfield (textfield with blur effect)
Label selectable (and clickable), and CheckBox with Label at the right.
(when textfield, passwordfield or checkbox are selected, the color is CYAN too)
I achieved to create that controls in a custom class extending Region, displaying a Text and Paths/Lines.
And subclasses specialize by adding textfield/checkbox items in it.
Related
In the current project,I am using an UIViewController with 2 text Fields and a text area.
Text fields are used as drop-down (custom logic) and based on drop-down selection information is displayed in text area for e.g. State and city are two drop down. On click of State drop down city data is populated in second drop down and on selection of city corresponding info is fetch and displayed in Text-area.
I have a requirement to move this logic to custom popup. Can anyone guide me how to achieve this with minimal changes in Xamarin iOS.
It would use UIPopoverController in this care. You already have a view controller with all the UI elements. You can use it as the DetailViewController so you don't have to change that much. Only it's size and the background. You can use it for both iPhones and iPads.
Here you have a sample project with source code:
https://developer.xamarin.com/samples/monotouch/Popovers/
Create a new UIViewcontroller in the storyboard, set the background colour of the main view to transparent, then create another view on top of that and put in any controls you want to display etc. then in the UIViewcontrollers init method add in the following:
public OverlayView(IntPtr handle) : base (handle)
{
ModalPresentationStyle = UIModalPresentationStyle.OverCurrentContext;
}
That way the background view that you've set as transparent won't just show black, it'll show in the context of the screen that called it, then you just present it as you would any other view, and add in some dismiss action events if you want it to pass data back etc. Hope this helps.
Hi Im new to Xcode7 and Swift2 and I am trying to change the color of the buttons I am adding to my storyboard. Is there a way to change the color of the button in Xcode7? All I see are options to change color of text and add background image to a button but no change button color.
A button has many parts / aspects, so what do you mean by the "button color"? You probably mean the button's background color. If you scroll down in the button's attributes inspector, you'll come to the background color. The reason it's so far down is that it's a View (UIView) property, not merely a button (UIButton) property.
Can I animate the HorizontalFieldManager in Blackberry?
I have a button in the bottom bar of the screen, and there is an array of images which display in a horizontal layout above the button.
When I click on the button, there should be a slide-in slide-out effect and the images appear one after the other.
Can anyone suggest me any tutorial or link for this?
I think the working approach will be in implementing your own custom bitmap field and placing it above the button, you want to press. When button is pressed, then intercept this event and update contents of your custom bitmap field.
Here is an example, how to create a custom field with RIM SDK.
I am using a custom editor when editing the contents of a cell inside a Table view. From the docs I see that the custom editor has to be an NSTextView. So I put the text view in the document view, then I referenced it from the cell subclass through an IBOutlet in order to assign it as custom editor.
When doing all this, I can set the editor not to draw its background, but a thick white border is shown when the user edits that cell, and there is no way to remove it.
So I create the NSTextView programmatically, assigned it as the custom editor, and no white border is shown, but I can't change the background now, set it to clearColor, set the font, fontColor etc. I can't do anything with it. It is just a square with dark background and white text.
Is there something I am not doing? This is a bad approach?
Thank you.
The border is drawn by drawRect:, but I still don't know how to fix it by overriding drawRect:...
You may have a look at this link: http://www.cocoabuilder.com/archive/cocoa/129091-solved-re-disabling-nstableview-big-black-editing-box.html#129259
I could not find a way in the documentation to tell an NSButton to resize its image to fill up the whole button. Is there a way to do this programatically?
The closest you'll get is -setImageScaling: ... look up the constants to see how the image will be scaled within the button cell, given its bordered state and bezel type.
If you're looking to replace the standard button entirely with your image (ie, the button cell doesn't draw itself at all - your image serves as the entire visual representation), turn off the border (-setBordered:).
All of these options can be configured in IB as well. A tip: in IB, hover the mouse over any setting in the inspector panel - most if not all give you a hint that shows what method controls the behavior affected by the setting's control.