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.

view
Filter by
Sorted by
Tagged with
671 votes
38 answers
439k views

Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy

Just started using Xcode 4.5 and I got this error in the console: Warning: Attempt to present < finishViewController: 0x1e56e0a0 > on < ViewController: 0x1ec3e000> whose view is not in the ...
Kyle Goslan's user avatar
  • 10.9k
10 votes
4 answers
16k views

Android ImageView Scaling and translating issue

I’m developing an android application (API 19 4.4) and I encounter some issue with ImageViews. I have a SurfaceView, in which I dynamically add ImageViews which I want to react to touch events. On so ...
Tifoo's user avatar
  • 131
278 votes
18 answers
212k views

Replace Fragment inside a ViewPager

I'm trying to use Fragment with a ViewPager using the FragmentPagerAdapter. What I'm looking for to achieve is to replace a fragment, positioned on the first page of the ViewPager, with another one. ...
Noodles's user avatar
  • 3,263
460 votes
7 answers
286k views

What is the main purpose of setTag() getTag() methods of View?

What is the main purpose of such methods as setTag() and getTag() of View type objects? Am I right in thinking that I can associate any number of objects with a single View?
Eugene's user avatar
  • 59.8k
162 votes
5 answers
298k views

Android - Dynamically Add Views into View

I have a layout for a view - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" ...
Josh's user avatar
  • 16.4k
487 votes
30 answers
401k views

Android: How do I prevent the soft keyboard from pushing my view up?

I have a vertical sliding drawer at the bottom of my app. When the soft keyboard opens, it pushes the tab for the drawer up, so it sits atop the keyboard. I actually want it to remain at the bottom of ...
Christopher Perry's user avatar
587 votes
15 answers
268k views

Difference between a View's Padding and Margin

What is the difference between a View's Margin and Padding?
Ragunath Jawahar's user avatar
729 votes
12 answers
666k views

Get root view from current activity

I know how to get the root view with View.getRootView(). I am also able to get the view from a button's onClick event where the argument is a View. But how can I get the view in an activity?
Lalith's user avatar
  • 20k
392 votes
18 answers
289k views

Animate change of view background color on Android

How do you animate the change of background color of a view on Android? For example: I have a view with a red background color. The background color of the view changes to blue. How can I do a ...
hpique's user avatar
  • 120k
344 votes
3 answers
154k views

onMeasure custom view explanation

I tried to do custom component. I extended View class and do some drawing in onDraw overrided method. Why I need to override onMeasure? If I didn't, everything seen to be right. May someone explain it?...
sennin's user avatar
  • 8,722
196 votes
8 answers
293k views

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 ...
Sephy's user avatar
  • 50.3k
76 votes
13 answers
140k views

Rotating a view in Android

I have a button that I want to put on a 45 degree angle. For some reason I can't get this to work. Can someone please provide the code to accomplish this?
Matthew's user avatar
  • 761
286 votes
11 answers
377k views

Set margins in a LinearLayout programmatically

I'm trying to use Java (not XML) to create a LinearLayout with buttons that fill the screen, and have margins. Here is code that works without margins: LinearLayout buttonsView = new LinearLayout(...
Timmmm's user avatar
  • 92.5k
71 votes
9 answers
66k views

Convert view to bitmap on Android

I need to convert a view to a bitmap to preview my view and to save it as an image. I tried using the following code, but it creates a blank image. I cannot understand where I made a mistake. View ...
SAM Bhadani's user avatar
259 votes
12 answers
215k views

setBackground vs setBackgroundDrawable (Android)

I want to set background drawable of a view. There are two methods for this (as far as I see): setBackground and setBackgroundDrawable. When I use setBackground, it says it has been added in API ...
Pijusn's user avatar
  • 11.2k
119 votes
13 answers
277k views

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's user avatar
  • 11.1k
245 votes
13 answers
498k views

How to Set Opacity (Alpha) for View in Android

I have a button as in the following: <Button android:text="Submit" android:id="@+id/Button01" android:layout_width="fill_parent" android:layout_height="wrap_content"> &...
ncakmak's user avatar
  • 4,024
111 votes
3 answers
158k views

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 ...
ssobczak's user avatar
  • 1,815
42 votes
4 answers
24k views

Store common query as column?

Using PostgreSQL, I have a number of queries that look like this: SELECT <col 1>, <col 2> , (SELECT sum(<col x>) FROM <otherTable> WHERE <other ...
ibrewster's user avatar
  • 3,552
200 votes
22 answers
520k views

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 ...
Peter vdL's user avatar
  • 4,973
323 votes
8 answers
369k views

How to create EditText with rounded corners?

How to create an EditText that has rounded corners instead of the default rectangular-shaped corners?
pixel's user avatar
  • 25.7k
286 votes
5 answers
223k views

View array in Visual Studio debugger? [duplicate]

Is it possible to view an array in the Visual Studio debugger? QuickWatch only shows the first element of the array.
user20493's user avatar
  • 5,774
63 votes
10 answers
250k views

Create a view with ORDER BY clause

I'm trying to create a view with an ORDER BY clause. I have create it successfully on SQL Server 2012 SP1, but when I try to re-create it on SQL Server 2008 R2, I get this error: Msg 102, Level 15,...
El Sa7eR's user avatar
  • 881
190 votes
5 answers
104k views

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 ...
Bite code's user avatar
  • 588k
141 votes
16 answers
72k views

Software keyboard resizes background image on Android

Whenever the software keyboard appears, it resizes the background image. Refer to the screenshot below: As you can see, the background is sort of squeezed. Anyone can shed a light on why the ...
Andreas Wong's user avatar
  • 60.1k
102 votes
4 answers
125k views

how to use views in code first entity framework [closed]

How can I use the database view in entity framework code first,
Sagar's user avatar
  • 1,727
60 votes
5 answers
125k views

MySQL: View with Subquery in the FROM Clause Limitation

In MySQL 5.0 why does the following error occur when trying to create a view with a subquery in the FROM clause? ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause If this is ...
Daniel's user avatar
  • 1,231
254 votes
19 answers
289k views

How to make a smooth image rotation in Android?

I'm using a RotateAnimation to rotate an image that I'm using as a custom cyclical spinner in Android. Here's my rotate_indefinitely.xml file, which I placed in res/anim/: <?xml version="1.0" ...
emmby's user avatar
  • 100k
188 votes
4 answers
132k views

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? ...
Christian's user avatar
  • 25.8k
95 votes
6 answers
108k views

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 ...
David C's user avatar
  • 2,786
71 votes
9 answers
97k views

Laravel 5 - global Blade view variable available in all templates

How can I in Laravel 5 make global variable which will be available in all Blade templates?
Limon Monte's user avatar
  • 53.4k
11 votes
2 answers
40k views

How to implement a view holder?

i am using a viewholder to display from a dynamic arrayadapter.it works but the data displayed changes irregularly when i scroll the List.i want my List View to be populated only once ,Not all the ...
Ads's user avatar
  • 6,701
251 votes
27 answers
190k views

Is there a way to programmatically scroll a scroll view to a specific edit text?

I have a very long activity with a scrollview. It is a form with various fields that the user must fill in. I have a checkbox half way down my form, and when the user checks it I want to scroll to a ...
NotACleverMan's user avatar
192 votes
8 answers
210k views

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 ...
aryaxt's user avatar
  • 77.1k
161 votes
8 answers
123k views

Measuring text height to be drawn on Canvas ( Android )

Any straight forward way to measure the height of text? The way I am doing it now is by using Paint's measureText() to get the width, then by trial and error finding a value to get an approximate ...
Danedo's user avatar
  • 2,243
76 votes
7 answers
132k views

Overlapping Views in Android

Is it possible to have overlapping views in Android? I would like to have an ImageView with a transparent png in the front and another view in the background. edit: This is what I have at the moment,...
Alexander Stolz's user avatar
61 votes
6 answers
31k views

Error referencing an inner class View in layout/main.xml

Grrr... I create a subclass of view as an inner class in my Activity. Before I simply linked to this view from my activity with: setContentView(new CustomView(this)); without problems. Now, ...
IcedDante's user avatar
  • 6,364
35 votes
13 answers
185k views

Codeigniter: Passing data from controller to view

I want to pass $data from the controller named poll to the results_view however I am getting an undefined variable error. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed')...
Andrew Lynch's user avatar
  • 1,307
31 votes
9 answers
37k views

android: ViewPager and HorizontalScrollVIew

I have a HorizontalScrollView inside my ViewPager. I set requestDisallowInterceptTouchEvent(true); for the HorizontalScrollView but the ViewPager is still sometimes intercepting touch events. Is ...
Android Noob's user avatar
35 votes
4 answers
29k views

ASP.NET MVC - View with multiple models

I am trying to generate such HTML <form action="/some/process" method="post"> <input type="hidden" name="foo.a" value="aaa"/> <input type="hidden" name="bar.b" ...
alex2k8's user avatar
  • 42.9k
129 votes
20 answers
182k views

How to make a view with rounded corners?

I am trying to make a view in android with rounded edges. The solution I found so far is to define a shape with rounded corners and use it as the background of that view. Here is what I did, define a ...
Zach's user avatar
  • 10k
70 votes
6 answers
92k views

Android : Get view Reference to a Menu Item

I plan to use quick actions UI pattern in my application. Android Quick Actions UI Pattern . The quick action window needs a pivot view to stick to. quickAction.show(View pivotView); I intend ...
Yashwanth Kumar's user avatar
40 votes
4 answers
35k views

Redraw a single row in a listview [duplicate]

Is it possible to redraw a single row in a ListView? I have a ListView with rows that are LinearLayouts. I listen to a preference change and sometimes I need to change just one View inside the ...
Falmarri's user avatar
  • 48.2k
38 votes
11 answers
34k views

Android - cannot capture backspace/delete press in soft. keyboard

I am overriding the onKeyDown method of the view (openGL surface view) to capture all of the key presses. The problem is that on several devices the KEYCODE_DEL is not captured. I have tried adding ...
Vladimir Gazbarov's user avatar
37 votes
5 answers
32k views

Programmatic Views how to set unique id's?

I am creating in my app bunch of programmatic Views. As it appeared to be they all by default have the same id=-1. In order to work with them I need to generate unique id's. I have tried several ...
Barmaley's user avatar
  • 16.4k
31 votes
4 answers
13k views

How to convert a View (not UIView) to an image?

Similar to this thread: How to convert a UIView to an image. I would like to convert a SwiftUI View rather than a UIView to an image.
JHack's user avatar
  • 311
96 votes
5 answers
49k views

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,...
dotty's user avatar
  • 41k
51 votes
7 answers
93k views

Android - Get time of chronometer widget

How to get the time from a Chronometer? I tried getText, getFormat, getBase, etc, but none of them could work. Example code snippet: Chronometer t = (Chronometer)findViewById(R.id.toptime); long ...
Isaac Waller's user avatar
  • 32.8k
24 votes
14 answers
9k views

Why is using '*' to build a view bad?

Why is using '*' to build a view bad ? Suppose that you have a complex join and all fields may be used somewhere. Then you just have to chose fields needed. SELECT field1, field2 FROM aview WHERE .....
Luc M's user avatar
  • 17k
175 votes
22 answers
480k views

Can we pass parameters to a view in SQL?

Can we pass a parameter to a view in Microsoft SQL Server? I tried to create view in the following way, but it doesn't work: create or replace view v_emp(eno number) as select * from emp where ...
arunachalam's user avatar
  • 1,939

1
2 3 4 5
44