Questions tagged [view]

This tag is for questions about database view or UI / architectural view. See also the following tags: sql-view, android-view, uiview.

The purpose of almost any computer program is to process data in one form or another. When the program requires user interaction it is often necessary to provide the user with a view of that data to represent it in a useful and comprehensible manner.

View also refers to:

  • A stored query in a relational database that can be accessed as if it were a table.
  • The display or presentation layer of a MVC architecture.

Questions tagged should also be tagged with the relevant language.

20281 questions
221
votes
13 answers

How to Set Opacity (Alpha) for View in Android

I have a button as in the following: In my onCreate() event, I am calling Button01…
ncakmak
  • 3,664
  • 4
  • 18
  • 17
216
votes
5 answers

Can I get the name of the current controller in the view?

Is there a way to figure out what the current controller is from within the view? For an example of why I would want to know this: if several controllers share the same layout, I may have a part in the layout ERB file where I want to highlight the…
Dan Tao
  • 119,009
  • 50
  • 280
  • 431
200
votes
6 answers

How to see the CREATE VIEW code for a view in PostgreSQL?

Is there an easy way to see the code used to create a view using the PostgreSQL command-line client? Something like the SHOW CREATE VIEW from MySQL.
Elias Dorneles
  • 19,202
  • 9
  • 63
  • 95
195
votes
21 answers

How to remove all subviews of a view in Swift?

I'm looking for a simple method to remove at once all subviews from a superview instead of removing them one by one. //I'm trying something like this, but is not working let theSubviews : Array = container_view.subviews for (view : NSView) in…
Alberto Bellini
  • 3,855
  • 5
  • 20
  • 35
192
votes
11 answers

Getting activity from context in android

This one has me stumped. I need to call an activity method from within a custom layout class. The problem with this is that I don't know how to access the activity from within the layout. ProfileView public class ProfileView extends LinearLayout { …
OVERTONE
  • 10,737
  • 20
  • 62
  • 86
192
votes
17 answers

Android: why is there no maxHeight for a View?

View's have a minHeight but somehow are lacking a maxHeight: What I'm trying to achieve is having some items (views) filling up a ScrollView. When there are 1..3 items I want to display them directly. Meaning the ScrollView has the height of either…
znq
  • 42,465
  • 38
  • 114
  • 143
185
votes
8 answers

Set the absolute position of a view

Is it possible to set the absolute position of a view in Android? (I know that there is an AbsoluteLayout, but it's deprecated...) For example, if I have a 240x320px screen, how could I add an ImageView which is 20x20px such that its center is at…
Sephy
  • 48,024
  • 30
  • 119
  • 129
184
votes
21 answers

How to set background color of a View

I'm trying to set the background color of a View (in this case a Button). I use this code: // set the background to green v.setBackgroundColor(0x0000FF00 ); v.invalidate(); It causes the Button to disappear from the screen. What am I doing wrong,…
Peter vdL
  • 4,765
  • 9
  • 37
  • 59
181
votes
4 answers

Android layout replacing a view with another view on run time

I have a xml-layout file main with two textviews A/B and a view C. I have two other xml-layout files option1 and option2. Is it possible to load either option1 or option2 in run time via Java into C? If so, what function do I have to use?
Christian
  • 21,975
  • 33
  • 117
  • 195
178
votes
3 answers

What is the difference between Xamarin.Form's LayoutOptions, especially Fill and Expand?

In Xamarin.Forms every View has the two properties HorizontalOptions and VerticalOptions. Both are of type LayoutOptions and can have one of the following…
Falko
  • 15,326
  • 12
  • 50
  • 91
176
votes
5 answers

Perform Segue programmatically and pass parameters to the destination view

in my app I've a button that performs a segue programmatically: - (void)myButtonMethod { //execute segue programmatically [self performSegueWithIdentifier: @"MySegue" sender: self]; } I would like to know if there is a way to reference the…
yassassin
  • 3,165
  • 6
  • 26
  • 30
174
votes
8 answers

Android - get children inside a View?

Given a View how can I get the child views inside it? So I have a custom View and debugger shows that under mChildren there are 7 other views. I need a way to access these views but it doesn't seem like there is a public API to do this. any…
aryaxt
  • 69,636
  • 87
  • 281
  • 421
169
votes
5 answers

What are dictionary view objects?

In python 2.7, we got the dictionary view methods available. Now, I know the pro and cons of the following: dict.items() (and values, keys): returns a list, so you can actually store the result, and dict.iteritems() (and the like): returns a…
e-satis
  • 515,820
  • 103
  • 283
  • 322
155
votes
7 answers

Difference between View and table in sql

Possible Duplicate: Difference Between Views and Tables in Performance What is the main difference between view and table in SQL. Is there any advantage of using views instead of tables.
Mahesh KP
  • 5,460
  • 11
  • 43
  • 68
154
votes
14 answers

SwiftUI - How do I change the background color of a View?

I'm beginning to try out SwiftUI and I'm surprised that it doesn't seem to be straightforward to change the background color of a View. How do you do this using SwiftUI?
jeremyabannister
  • 2,362
  • 3
  • 11
  • 19