Questions tagged [custom-view]

It is possible to create custom views by:

  • Compound views - combining views with a default wiring

  • Custom views - creating your own views

    a) by extending an existing view, e.g. Button, TextView, EditText, ListView, CheckBox, RadioButton, Gallery, Spinner, AutoCompleteTextView, ImageSwitcher, and TextSwitcher.

    b) by extending the View class

Creating custom views

By extending the View class or one of its subclasses you can create your custom view.

Creating your own View subclasses gives you precise control over the appearance and function of a screen element.

For drawing view use the onDraw() method. In this method you receive a Canvas object which allows you to perform drawing operations on it, e.g. draw lines, circle, text or bitmaps. If the view should be re-drawn you call the invalidate() method which triggers a call to the onDraw() method of this view.

If you define own views, ensure you review the ViewConfiguration class, as it contains several constants for defining views.

To draw your Views you typically use the 2D Canvas API.

Useful links:

644 questions
0
votes
1 answer

iOS 7: Change height of UIAlertView

I've gone through several posts explaining how to change alert view height but none of worked for me. Here is the scenario: I am inserting a custom view inside alert view like this: MyViewController *myViewController = [self.storyboard…
Tejas Sutar
  • 747
  • 2
  • 11
  • 33
0
votes
0 answers

xcode how to refresh MapView with custom annotations?

I am using MapView with Custom Annotations. I let user change map view type and once it is changed then all the annotations are looking as default (red). Is there anything special I need to do to keep my annotations with custom view? How can I get…
mrRany
  • 3
  • 5
0
votes
1 answer

My app is running but the screen is black, and crashes when trying to use a custom view

I have been working on creating a simple guitar tuner for my phone. I am fairly new to android development and have tried to understand the process of creating a guitar tuner with…
0
votes
2 answers

Android - Creating Custom Compound Component

I have started coding in Android just a couple of weeks ago and before that i never used oop (i have some background in c and embeded c for microcontrollers etc), so because of that i might get this idea totally wrong, but i need help to continue: I…
0
votes
2 answers

Adding action to custom uiview

I have been trying to do this simple thing : adding an action to a simple custom view. I have looked over the internet and found two "easy" solution : UITapGestureRecognizer UIButton I want to do this programmatically and I just need to handle the…
Ambroise Collon
  • 3,839
  • 3
  • 18
  • 37
0
votes
1 answer

Change childView property dynamically

I have a custom view , I have put some TextView inside that and i have to change the layout property of each child view differently. I won't able to change textview property by xml, Here is my xml:
DjP
  • 4,537
  • 2
  • 25
  • 34
0
votes
2 answers

Custom UIView widget with UIScrollView not scrolling

I am trying to develop a new custom UIView (to allow for horizontal date selection). I want to do all the UI design in XIB files. The custom UI view contains a scrollview and then two 'week' views. The idea is that as the scrolling occurs, I will…
Charlie
  • 310
  • 2
  • 14
0
votes
0 answers

how tile screen with my images right same google mapview android

I have a image that sliced as png files and in 32*32 size.I only want tile my screen right same google mapview with my images.how can i do it please get me idea and example for doing it.
zohreh
  • 1,055
  • 1
  • 9
  • 26
0
votes
1 answer

Custom Input view using Storyboard

I need to create a custom input view which will appear if i tap on a textfield.I have gone through apple documentation,but i felt it unclear,I am using storyboard also.How to achieve this using storyboards? I have also gone through similar questions…
Suraj K Thomas
  • 5,773
  • 4
  • 52
  • 64
0
votes
1 answer

Issue with Custom view on Action Bar in android

I am trying to set custom view on ActionBar in android, My code is given below: getSupportActionBar().setDisplayHomeAsUpEnabled(false); getSupportActionBar().setDisplayShowCustomEnabled(true); …
Hiren Patel
  • 52,124
  • 21
  • 173
  • 151
0
votes
0 answers

Android custom SeekBar with label

I am new to developing for android, could you suggest how to create seekbar or ? I've tried this, but my thumb after changing disappears. Plese help.
5mi13
  • 1
  • 1
  • 3
0
votes
1 answer

how to redraw custom view from the controller in ios objective-c

I have a custom view with 3 buttons taking full width. I import the class to my controller where I want to hide on button (menuBtn) and make one of the one of the other buttons (searchbarBtn) be bigger to fill the empty space by…
Pedroinpeace
  • 1,419
  • 1
  • 14
  • 20
0
votes
0 answers

SplitView or a CustomView in iOS

I am working on an app that really needs to use several tables and various views. I initially thought that I should use a splitview controller. However, I don't like the amount of space the masterview takes up and the limitations imposed by the…
physics90
  • 946
  • 3
  • 9
  • 24
0
votes
1 answer

View Drawing - Core foundation vs NSColor

While drawing view background what is the best practice to follow? using NSColor and NSRectfill or using Core Foundation objects like CGColorRef and CGContextSetFillColorWithColor? is there any performance benefits when you use Core foundation…
Suhas Aithal
  • 842
  • 8
  • 20
0
votes
1 answer

how to put a custom view into a custom list view for list fragment

I am having a custom layout for the list fragment. Inside that custom list layout, i want to put another custom view (which do drawing things). So my question is: how to add another view to convertView in method getView(). Here is my getView…
ngunha02
  • 1,719
  • 1
  • 19
  • 24