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

extjs 4 how to wrap children components of container in custom html?

I need to create Twitter Bootstrap basic NavBar component in my ExtJS 4.2 application. All I want to make my component generate the following html:
0
votes
1 answer

Arranging buttons in a circle (Android) with lines connecting them

I am attempting to create a Fragment for an Android application where I have either Buttons or ImageButtons programatically arranged in a circle, with lines drawn from them to the center of the View. However, I have become stumped as to how to do…
cshadowstar
  • 303
  • 2
  • 17
0
votes
6 answers

How to push New View Controller From any dynamic button click which is in CustomTableViewCell?

I have one tableview in my viewcontroller and in that i have customTableViewCell.i have dynamic buttons which generated runtime in my customeview cell.and on that button's click i want to push my view controller which is holding my tableview…
BhavikKama
  • 8,566
  • 12
  • 94
  • 164
0
votes
1 answer

Assign IBAction to custom navigationBarItem

I'm using custom UIViews to as navigationBarItem (like Facebook does it in their iOS app). UIImageView *linkesMenu = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"187menu.png"]]; UIBarButtonItem *barItem = [[UIBarButtonItem alloc]…
Constantin Jacob
  • 488
  • 1
  • 8
  • 21
0
votes
0 answers

Custom View inside HorizontalScrollView, surfaceCreated not getting called

I am trying to have a CustomView inside a HorizontalScrollView. In the Root layout there are three Layouts, FrameLayout, RelativeLayout and in the end HorizontalScrollView. I am adding a custom view which extends surface view. The Layout XML is as…
Vasu
  • 1
  • 1
0
votes
1 answer

ASP.NET user browse selected/restricted raw data from sql-server

In an ASP.NET WebForms application I would like to allow the end-user to browse selected raw data in an sql-server database. However, I would like to restrict access for the user to only view some of the data based on the username. I'm not sure how…
Ole Lynge
  • 4,457
  • 8
  • 43
  • 57
0
votes
1 answer

TextView inside a CustomView inside a ListView is truncating horizontally

I'm using a TextView inside a a "LabeledTextView" component (Basically, a TextView whose label moves from one side to the other when dealing with Layout changes caused to due Right to Left languages). I'm using this inside a ListView and this is…
Graeme
  • 25,714
  • 24
  • 124
  • 186
0
votes
1 answer

Access the content form customview in android

I am using the customview to add a xml in my Actionbar in ICS..Here is the code...I want to access the xml contents ActionBar actionBar = getActionBar(); actionBar.show(); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); …
NRahman
  • 2,717
  • 5
  • 24
  • 29
0
votes
2 answers

how to get checkbox of actionbar work (added by setCustomView )?

Im trying to use a checkbox in actionbar,im using actionbarsherlock. i've tried very hard to get the checkbox work,now I've made the UI (bu using the setCustomView method),but I'm stucked at catch the check event of the checkbox,I did some research…
magui
  • 50
  • 5
0
votes
1 answer

Setting the properties of items in an customview in iOS

I am creating a customView and for example, would like to set the text color of the label and initialise the text of the label. The initWithFrame is the generic function. - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; …
lakshmen
  • 28,346
  • 66
  • 178
  • 276
0
votes
1 answer

Get data from all rows in ListView with CustomViews

Android 2.3.3, MinSDK = 8 I have a ListView, with CustomView (with an Image, two textviews and 1 checkbox) for each row. I have a button called Add Contacts. On click of this button, I have the check whether the checkbox is checked or not. If…
Vamsi Challa
  • 11,038
  • 31
  • 99
  • 149
0
votes
1 answer

Adding both image and title to a navigation backBarButtonItem

I'm trying to add an icon (and keep the title) to the back button of my navigation controller. It seems if I set the image of the UIBarButtonItem it hides the title, so I thought I'd try a custom view. I've tried UIButton* customButton = [UIButton…
Trevor
  • 21
  • 5
0
votes
1 answer

Android User Interface Like Unlock Pattern Android

I want to make a something like a draw/game application to practice with the user interaction. but I want it to work and look like the android's security "unlock pattern". I mean I want to draw the circles and when the user interacts with them by…
cesaregb
  • 765
  • 1
  • 11
  • 27
0
votes
1 answer

How to replace my CustomView with different Xib's

I placed one customView on my window in .xib file. In that CustomView I have to load different views(xibs consist of CustomViews) from different xib files. I am able to display any of those xib's for first time, but when I want to display any other…
KrishnaTeja
  • 117
  • 2
  • 11
0
votes
1 answer

iOS - Custom view with touch event

I'm trying to creating a custom UIView, lets call it FooView. FooView.h #import @interface FooView : UIView @property (nonatomic, strong) UITextField *barTextField; @property (nonatomic, strong) UIButton…
Js Lim
  • 3,625
  • 6
  • 42
  • 80