Questions tagged [view-hierarchy]

A view hierarchy defines the relationships of the views to one another.

view-hierarchy
Filter by
Sorted by
Tagged with
49 votes
0 answers
7k views

SwiftUI UITableView was told to layout its visible cells and other contents without in view hierarchy

I have a list in a view (lets call it view A) where I push a view B via NavigationLink from view A and manipulate the CurrentSubjectValue to the initial view A. The moment the data is added and the ...
Congruent Tech. UG's user avatar
44 votes
5 answers
47k views

ConstraintLayout views in top left corner

Every time I create views like Button and TextView in ConstraintLayout, they all get stuck at the top corner instead of where I placed them. I tried to create new activities and change the emulator, ...
hassanito hajj's user avatar
43 votes
0 answers
5k views

Traversing the View Hierarchy on an iPhone or iPad [duplicate]

Here is a helpful routine you can use in an iOS app to traverse the view hierarchy when you want to know what's being created and where it's going. This routine dumps the view hierarchy to NSLog() ...
Sophtware's user avatar
  • 1,796
15 votes
6 answers
36k views

First view above / overlapping second in LinearLayout

Is it possible to show the first view in a LinearLayout overlapping the second? I would like to layout my views like so: <LinearLayout android:layout_width="wrap_content" android:...
RileyE's user avatar
  • 11k
7 votes
1 answer
6k views

Child view controller should have parent view controller but actual parent is (UIViewControllerHierarchyInconsistency)

I have an app which has UITabbarController as the initial window(after logging-in i set it as rootViewController) This tabbarController has 4 different tabs in it which are all UIViewControllers ...
Radun C's user avatar
  • 79
6 votes
4 answers
3k views

Why does minHeight attribute not work in WebView Android?

This question has already been asked here, but it has no solution. I have a WebView. I want to set minimum height to the WebView using minHeight attribute, but it doesn't work. The same attribute ...
thedarkpassenger's user avatar
6 votes
1 answer
2k views

Error grabbing View Hierarchy, XCode 8.2.1: "No plist data for fetching view hierarchy"

While trying to debug my view hierarchy, I get the following error: Error: Unable to capture view hierarchy. Details: No plist data for fetching view hierarchy: error evaluating expression “(id)[(...
Vaiden's user avatar
  • 15.9k
6 votes
1 answer
3k views

android get view hierarchy for all windows in activity

I am making SKD for Automation. So my needs are slightly different that normal app development. Requirement: Get ViewHierarchy of current activity. Problem: I get it correct when Spinner is not open. ...
TorukMakto's user avatar
  • 2,066
4 votes
2 answers
1k views

View is in the last position of parent, but still being blocked

What I want to do In a BottomSheetDialogFragment, I want to inflate a view that always stick at the bottom of the screen, no matter what state (collapsed / expanded) the BottomSheetBehavior is in. ...
Sira Lam's user avatar
  • 5,259
4 votes
2 answers
1k views

SwiftUI - How to change hierarchical position of View?

Here's a basic example of what doesn't work: import SwiftUI struct Test : View { @State var swapped = false var body: some View { if swapped { Color.green } Color.blue....
jeremyabannister's user avatar
3 votes
2 answers
2k views

onTouch() not called for parent layout

I have a layout like this: LinearLayout RelativeLayout(id = test) FrameLayout (From a LIB. id = lib) I tried to add onTouchListener() to test but it doesn't work. I tried: @OnTouch(R....
ketom's user avatar
  • 2,414
3 votes
1 answer
1k views

Inspecting an Android Activity's own View hierarchy at runtime

Is it possible for an Activity to get to and inspect, ideally even modify, the entire View hierarchy for itself, without knowing IDs of all the views or special access such as instrumentation mode or ...
Cumbayah's user avatar
  • 4,457
3 votes
1 answer
427 views

viewWillAppear not called apparently due to my view hierarchy

This appears to be a well documented problem, yet the solutions online have not worked. Here's just a sample list of posts that failed to provide me with a working answer: ViewWillAppear not ...
michaeldebo's user avatar
  • 3,085
3 votes
0 answers
661 views

FrameLayout not respecting draw order

I've this layout hierarchy: <FrameLayout> <ScrollView>...</ScrollView> <LinearLayout>...</LinearLayout> <LinearLayout>...</LinearLayout> </...
GuilhE's user avatar
  • 11.8k
2 votes
1 answer
2k views

SwiftUI - Responding to taps in parent View

TL;DR: I want to trigger an action when (parent) state changes. This seems difficult in a declarative context. Remarks The challenge here is that I am not trying to make a property of one view ...
Andrew Duncan's user avatar
2 votes
1 answer
3k views

Android: On touch event not received by parent view

I have a relative layout R1 as a custom view for an expandable list view. Now inside R1, i have one Image view I1 and another relative layout R2, both being siblings. I have set on click listeners ...
Sunny's user avatar
  • 7,544
2 votes
1 answer
217 views

How to find where UIView has been created in code - swift - Programmatically

If I see a UIView in Debug View Hierarchy and I don't know where it comes from, Is there a way to see where it has been programmatically created in code? This question describes and explains the ...
StackGU's user avatar
  • 938
2 votes
3 answers
632 views

What is the best practice: Multiple UIViews or Multiple UIViewControllers [closed]

I plan to develop an check list app that consists of multiple pages. Each page is going to display a list of simple Yes/No questions and a "Next" button at the bottom of the page. In terms of the app ...
David's user avatar
  • 3,398
2 votes
1 answer
855 views

Set autolayout constraints programmatically

I can't figure out how to fix this: I want to create a match game, where the size of the cards depends on the device. I thought I would create a contentView which I pinned to top and bottom of the ...
Myriam's user avatar
  • 73
2 votes
2 answers
1k views

android view hierarchy does not capture the custom view widget tree structure

I am trying to use DDMS hierarchy viewer to capture the virtual view hierarchy (tree structure of the custom view widget). This custom view widget is from android's sample code ApiDemos which has the ...
user2646986's user avatar
1 vote
2 answers
4k views

How to get selected child in GridLayout similar to GridView

I want to achieve the following abilities: Select only one child View inside a GridLayout each time by long clicking it. A click on the GridLayout or any ancestor parent in the visual hierarchy will ...
Eido95's user avatar
  • 1,361
1 vote
2 answers
268 views

android consolidating views in include statements, improve performance?

I am optimizing my android layouts. One suggestion I got was to re-use layouts in include statements. Although I understand the utility of this, kind of like object orientated views, but does it ...
CQM's user avatar
  • 43.4k
1 vote
1 answer
546 views

SwiftUI ZStack and Xcode 3D View Hierarchy

I'm learning SwiftUI. When I have a ZStack say ZStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") } ...
newbie py's user avatar
1 vote
1 answer
592 views

Customizing UINavigationBar not working because of weird UINavigationBar view hierarchy

My app has many ViewControllers that are pushed on navigation stack. I have configured UINavigationBar appearance globally in AppDelegate as below. let appearance = UINavigationBar.appearance() ...
Vincent Gigandet's user avatar
1 vote
1 answer
269 views

Blank screen first time launching app xcode

I am having a little issue with logging into an app the first time with a blank screen and I am getting the warning "Attempt to present on whose view is not in the window hierarchy!" After I close ...
user3708224's user avatar
  • 1,249
1 vote
1 answer
83 views

Root VC being deallocated by a second modal

Recently I have developed a custom modal animation using the UIViewControllerTransitioningDelegate where the calling view controller should be visible after the transition, i.e. its modal is over ...
Lucas Fonseca's user avatar
1 vote
0 answers
411 views

Xcode debug cannot capture view hierarchy on macbook M1

In one project, 'capture view hierarchy' and 'pause program execution' buttons are simply not working. 1 out of 20 times it's showing blank screen saying Unable to capture view hierarchy, but other ...
hikmat_11's user avatar
1 vote
0 answers
320 views

Simultaneous Gestures not working for a ZoomableScrollView in SwiftUI

Using Swift5.3.2, iOS14.4.1, Xcode12.4, I am trying to use the .simultaneousGesture modifier in SwiftUI. As far as I understood, this modifier should make sure that gestures (such as tap, longpress, ...
iKK's user avatar
  • 6,764
1 vote
0 answers
858 views

Access to UITransitionView's From UIWindow

In my application I have a UINavigationController, After authentication I run perform segue(Push replace) for navigating to UINavigationController, when app goes to background I present Authentication ...
Hamed's user avatar
  • 1,748
1 vote
0 answers
498 views

Error obtaining UI hierarchy and Screen not available

I use Android Device Monitor to check my Android App view hierarchy. Run the app in android studio's device simulator. Open the Android Device Monitor. Then choose my App and Dump View Hierarchy ...
LF-DevJourney's user avatar
1 vote
0 answers
58 views

A view that can be moved and resized on android

I'm making an app that should allow users to dynamically put ImageViews into existence, move them where they please, resize them and mess around with the layer stacking of said views. The layer ...
Larpus's user avatar
  • 301
1 vote
0 answers
220 views

Android Fragments: restore programmatically added views

I have two fragments: fragmentA and fragmentB In fragmentA, some views have been programmatically added If from fragmentA I go to fragmentB and then I come back to fragmentA, all the ...
Daniele B's user avatar
  • 20.2k
1 vote
0 answers
709 views

StackOverflowError because of too deep view-hierarchy in Android

we get in the Play Store some crash reports of this kind: java.lang.StackOverflowError at android.graphics.Paint.getTextRunAdvances(Paint.java:1753) at android.graphics.Paint.getTextRunAdvances(Paint....
user3625049's user avatar
0 votes
2 answers
2k views

Is there any free library that I can use to make tree view structure in react JS [closed]

I want to make a tree view structure in React JS. I already use the package "goJS" but I am facing some issues in it. As the price of this package is very high so I can't purchase it. The ...
mohsin hussain's user avatar
0 votes
1 answer
605 views

View Hierarchy not showing on XCode 13

I recently updated Xcode to Xcode 13. I opened an old project and tried to edit a xib file with interface builder. I can't figure out how to show the view hierarchy that used to be on the left on IB. ...
Sébastien Sutterlin's user avatar
0 votes
3 answers
2k views

VideoPlayer in SwiftUI stops playing when parent-View updates

Using Swift5.3.2, iOS14.4.1, Xcode 12.4, I am successfully running a VideoPlayer in SwiftUI. I am calling the Player view with this code: VideoPlayer(player: AVPlayer(url: url)). The problem is that ...
iKK's user avatar
  • 6,764
0 votes
2 answers
657 views

android:layout_alignTop does not work similar to android:layout_alignBottom

I try to create a semi-transparent red View and a TextView inside RelativeLayout, which the height of View follows the height of TextView, it works as expected when the TextView is above the semi-...
ggrr's user avatar
  • 7,777
0 votes
1 answer
45 views

Control doesnt respond to mouse actions because it's on bottom of view hierarchy

I have a ContentControl with following DataTemplate xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf" .... <DataTemplate DataType="{x:Type y:DataGraph}"> <Grid> ...
bart's user avatar
  • 314
0 votes
0 answers
412 views

TabView disconnects when rotating to Landscape due to SwiftUI's re-render of parent-Views

Using Swift5.3.2, iOS14.4.1, XCode12.4, As the following code shows, I am working with a quite complex TabView in Page-Mode in SwiftUI. i.e. using iOS14's new possibility to show Pages: .tabViewStyle(...
iKK's user avatar
  • 6,764
0 votes
1 answer
103 views

Warning: Attempt to present ViewController on ViewController whose view is not in the window hierarchy (w/ UIAlertController)

I'm building a chat app where there are two types of views to be modally presented over the chat screen: a UIAlertController for users to select media to send, and a popover if the current user wants ...
James M's user avatar
  • 41
0 votes
3 answers
121 views

Component child selector with extended template

I want to create component with view hierarchy outside of Router and RouterModule Example: comp-parent.ts @Component({ selector: 'comp-parent', template: ` <p>parent works</p&...
Mike Quoro's user avatar
0 votes
1 answer
165 views

NavigationController and View Hierarchy issue

I have 1 (rootViewController) view controller which is embedded in navigation controller. Then i pushed another view controller (secondViewController), which has search controller in title view. When ...
 Dmitriy Greh's user avatar
0 votes
0 answers
177 views

Presenting new view controller - View is not in the window hierarchy

I am receiving a warning: "Warning: Attempt to present on whose view is not in the window hierarchy!" I think I have a logic problem related to the presentation of the new view controller via a ...
Pigpocket's user avatar
  • 458
0 votes
0 answers
522 views

Xcode 9 Debug View Hierarchy extremely slow

Before Xcode 9, Debug View Hierarchy completely created a visual interactive representation of the UI in about two seconds. Now, in Xcode 9, it takes about 15 seconds. Is there any setting to make it ...
Can Poyrazoğlu's user avatar
0 votes
1 answer
269 views

How to put layout between others layout in RelativeLayout?

I have a RelativeLayout. Inside it I have: An ImageView 120x120 dp in the right. 3 other layouts in the left: 1st layout (called Top) has alignParentTop=true 2nd layout (called Bottom) has ...
TOP's user avatar
  • 2,614
0 votes
1 answer
197 views

How do I inspect the "Debug View Hierarchy" while iOS device is plugged?

I know that "Debug View Hierarchy" work on 32-bit Mac App Projects and it doesn't support every type of iOS Simulator. But I can use on some of iOS Simulator. Right now, I'm using ...
Göktuğ Aral's user avatar
0 votes
1 answer
178 views

Curtain revealing view

I am trying to achieve the following challenging effect: I want to move the white "curtain" down in order to reveal the red box. (Note: in the screenshots below the curtain is white and the background ...
user-123's user avatar
  • 884
0 votes
0 answers
113 views

Why does my textField disappear?

I do some practice with iPhone4S about UITextField on iOS 7.1.2. Interface: The interface of the first version is simple, which just has a custom UITextField named MyUITextField and a UIButtom ...
nora's user avatar
  • 1
0 votes
1 answer
541 views

UIScrollView tap gesture not working

I have an application where I am creating and adding PrimaryViewController to a UIScrollView, when the user taps on a button on PrimaryViewController's view, I create and add a SecondViewController to ...
tentmaking's user avatar
  • 2,136
0 votes
2 answers
77 views

Detect a touch on a subview in a main controller

I have a main view controller class which contains a UIScrollView and a number of subviews like cards. Each card is an object and it is covered with a UIButton. I want to detect a tap on the UIButton ...
Dimil T Mohan's user avatar