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
3 answers

Android custom view causing force close

I have a custom view in src > myproject.test > HomeView In my main layout xml I have the following:
skyfoot
  • 20,629
  • 8
  • 49
  • 71
0
votes
1 answer

Turn Words Inside an EditText Into a Contact Icon

I'm not quite sure what to even call this. Rather than plain text editing I'd like to implement the same system here, so when a user types in other users' names followed by a space the name is replaced with a view like below. What are the basic…
Zach
  • 447
  • 6
  • 16
0
votes
1 answer

Tap & hold to show complete text in UILabel

I have a UILabel which do not show complete text due to limited frame (frame can't be changed); ellipsis is shown in the end. I want to implement a feature wherein on tap and hold on UILabel, a pop-over with a magnifier appears and user is allowed…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
0
votes
1 answer

WPF custom View without Generic.xaml

I am trying to implement custom views that are specific to an application without any luck. Here is my problem: I need a custom view because I would like for the user to be able to switch views dynamically at runtime. I need a custom view (as…
Fragilerus
  • 1,829
  • 3
  • 15
  • 22
0
votes
1 answer

Custom camera view UWP C#

How can I make custom camera view, like Messenger app has, for example? With possibility of making photos and using flash? I have trying to use UWP samples, but I couldn't find a suitable solution.
AlIon
  • 347
  • 5
  • 25
0
votes
1 answer

android: Using Global Multidimensional array variable in CustomView

how to get or set a Multidimensional array variable value when using a global class. tried different ways no success my Global class public class Global extends Application { private String [][][] myarray=new String[10][10][10]; public…
0
votes
1 answer

How to get context in GameSurfaceView?

I have a Main Activity and in the corresponding XML Layout I have a Custom View that draws game objects (my tank and 10 enemies), a few buttons to control my tank and fire bullets and a TextView to show my score. My custom view is a GameSurfaceView…
Ahmad
  • 1
  • 3
0
votes
1 answer

ios Custom annotation view using storyboard in MapKit

I'm trying to add a custom annotation view in mapkit . When I tap on red annotation pin , I got an annotation callout,but it is very simple.I want to add a custom view which I have made in the storyboard. Can you please provide me a video or text…
0
votes
1 answer

iOS Custom Views don't show up

I'm developing an app (by a tutorial, but the tutorial is written for Swift and I'm learning Objective-C. tutorial source But I have a problem, I'm developing a Custom Controller (RatingController), which works when I only use one of this custom…
Gilian J
  • 3
  • 2
0
votes
1 answer

Rails Admin Creating and Using Custom Views

Is there any option for creating a Custom view in Rails Admin ? I tried to find information about, but unsuccessfully.
Nezir
  • 6,727
  • 12
  • 54
  • 78
0
votes
1 answer

Custom View with Three Circle Images Android

I wanna create a custom view with three circle images view using native android. Now I can create one circle image view using CircleImageView from hdodenhof. I wonder if anyone can tell me which way is better to put three circles like the following…
Jennifer He
  • 75
  • 1
  • 2
  • 10
0
votes
1 answer

User selects nodes for a custom view (DRUPAL)

all, I hope you can either help me, or direct me the the easy-to-find-in-retrospect answer which is already out there. I have had two drupal RFPs in the past month where the admins maintains content, but wants users to be able to mark nodes for…
Trass Vasston
  • 679
  • 2
  • 6
  • 19
0
votes
1 answer

CustomView in ActionBar disappear when orientation change ? (AppCompat)

Problem : I personalized my actionBar (SupportActionBar) with a renderer on my CustomNavigationPage beacause I use AppCompat theme. So, I added my CustomView (a SearchBar) in the actionbar from this class. But ... when we change the orientation…
0
votes
1 answer

Updating Android UI from custom view

I'm new to Android development, and still having difficulties comprehending how the framework works. I try to write a simple game to get some experience and I'd like to ask for some help with the below. In my main Activity, I have a few TextViews to…
Daniel SH
  • 123
  • 1
  • 8
0
votes
1 answer

Custom PieProgress in android

Hi i want to draw a PieProgress like an attached image. Any Suggestion ? I can draw this Progress but how can i place this parallel image on the center of this progress bar.
nitin tyagi
  • 1,176
  • 1
  • 19
  • 52