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.

25981 questions
119
votes
14 answers

Is it possible to determine whether ViewController is presented as Modal?

Is it possible to check inside ViewController class that it is presented as modal view controller?
lukewar
  • 2,715
  • 3
  • 19
  • 16
115
votes
13 answers

How can I dynamically set the position of view in Android?

How can I change the position of view through code? Like changing its X, Y position. Is it possible?
Arun Badole
  • 10,977
  • 19
  • 67
  • 96
110
votes
4 answers

How to efficiently get a `string_view` for a substring of `std::string`

Using http://en.cppreference.com/w/cpp/string/basic_string_view as a reference, I see no way to do this more elegantly: std::string s = "hello world!"; std::string_view v = s; v = v.substr(6, 5); // "world" Worse, the naive approach is a pitfall…
sehe
  • 374,641
  • 47
  • 450
  • 633
109
votes
1 answer

What is the difference between getWidth/Height() and getMeasuredWidth/Height() in Android SDK?

The Android Documentation says that there is two sizes for a view, the measured dimensions and the drawing dimensions. The measured dimension is the one computed in the measure pass (the onMeasure method), while the drawing dimensions are the actual…
lgfischer
  • 1,718
  • 3
  • 13
  • 22
109
votes
3 answers

Can I create view with parameter in MySQL?

I have a view like this: CREATE VIEW MyView AS SELECT Column FROM Table WHERE Value = 2; I'd like to make it more generic, it means to change 2 into a variable. I tried this: CREATE VIEW MyView AS SELECT Column FROM Table WHERE Value =…
ssobczak
  • 1,795
  • 3
  • 18
  • 28
102
votes
4 answers

how to use views in code first entity framework

How can I use the database view in entity framework code first,
Sagar
  • 1,727
  • 4
  • 22
  • 30
101
votes
10 answers

How to pass one SwiftUI View as a variable to another View struct

I'm implementing a very custom NavigationLink called MenuItem and would like to reuse it across the project. It's a struct that conforms to View and implements var body : some View which contains a NavigationLink. I need to somehow store the view…
Alex
  • 1,023
  • 2
  • 7
  • 9
97
votes
14 answers

What are views good for?

I'm just trying to get a general idea of what views are used for in RDBMSes. That is to say, I know what a view is and how to make one. I also know what I've used them for in the past. But I want to make sure I have a thorough understanding of…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
96
votes
11 answers

Difference between View and ViewGroup in Android

What is the difference between a View and a ViewGroup in Android programming?
user3927549
  • 1,005
  • 1
  • 7
  • 3
96
votes
6 answers

Check if an object exists

I need to check if Model.objects.filter(...) turned up anything, but do not need to insert anything. My code so far is: user_pass = log_in(request.POST) # form class if user_pass.is_valid(): cleaned_info = user_pass.cleaned_data user_object…
sinθ
  • 11,093
  • 25
  • 85
  • 121
95
votes
5 answers

creating my own context processor in django

I have come to a point where I need to pass certain variables to all of my views (mostly custom authentication type variables). I was told writing my own context processor was the best way to do this, but I am having some issues. My settings file…
dotty
  • 40,405
  • 66
  • 150
  • 195
94
votes
6 answers

MVC Razor view nested foreach's model

Imagine a common scenario, this is a simpler version of what I'm coming across. I actually have a couple of layers of further nesting on mine.... But this is the scenario Theme contains List Category contains List Product contains List My…
David C
  • 2,766
  • 6
  • 29
  • 44
94
votes
12 answers

How to set the title of a Navigation Bar programmatically?

I have a Navigation Bar in a view, and I want to change its Navigation Item title programmatically. How is this done?
Doug Null
  • 7,989
  • 15
  • 69
  • 148
91
votes
7 answers

Can I have a foreign key referencing a column in a view in SQL Server?

In SQL Server 2008 and given TableA(A_ID, A_Data) TableB(B_ID, B_Data) ViewC(A_or_B_ID, A_or_B_Data) is it possible to define TableZ(A_or_B_ID, Z_Data) such that Z.A_or_B_ID column is constrained to the values found in ViewC? Can this be done with…
marc
  • 3,248
  • 4
  • 28
  • 33
90
votes
6 answers

MySql views performance

If you are going down the road of using views, how can you ensure good performance? Or is it better not to use views in the first place and just incorporate the equivalent into your select statements?
Ed Heal
  • 59,252
  • 17
  • 87
  • 127