In a previous Eclipse version there was a button at the top right of the XML editor graphical layout screen that basically expanded the screen so you could see the object that were off the viewable screen.
Like if you more objects (like TextView, Button etc) so you add a ScrollView. In the code you place the other objects but there is no way to see them, graphically.
I updated everything in Eclipse a few days ago and this button seems to have disappeared.
Does anyone know how to do this or is this functionality gone?
In the latest version, that toggle button is gone, and instead the mode it used to control is automatically entered when the root view is a ScrollView.
HOWEVER, there was a bug in the code which meant that the actual measurements (which the expansion-mode relies on) were wrong. It's been fixed but not yet integrated.
-- Tor
Related
I have watched numerous videos, including Google's own, and i'm really struggling with ConstraintLayout, it simply doesn't work for me, like it works in the online videos.
When I drop a textview onto the constraint layout editor, it jumps to the top right of the form. In the demo videos, it stays where it's dropped, and it's easy for those people to set up the relationships by dragging handles. For me, It's all up in the top right, and I can only get to 2 of the handles.
It gets worse if I then drop two more text views into the form, they are all now all the same size and all overlapped at the top. Whenever I use constraint layout, I end up tearing my hair out, and then giving up and going back to an older layout.
I really want to use constraintlayout, but clearly I am missing something really obvious here, but I can't figure out what.
Yes the drag and drop doesn't work well. For me I just use several steps to add a new view:
1. drag new view to the end of the view list window (not on the design view! design view will add unnecessary properties and is not clean)
2. select the new view, and name it! name is very important to constraint layout.
3. set the layout_constraint_xxx attributes from the property window
then it goes to the expected places.
Try disabling the experimental render engine and re enable it again
In order to make things clean for you to understand i recorded a video
The problem is that when i'm adding a Tab Layout inside another layout everything that appears in the blueprint becomes a dot in the upper left corner, leaving me with no other choice but to edit the xml itself in order to create the UI. This also happens sometimes when I add multiple nested layouts.
I'm searching like a week until now but still i can't understand why is this happening.
I can understand maybe Android Studio 2.2 is different but I feel like it's not working at all with GridLayout, I'm watching thenewboston tutorial 17 for GridLayout, and when he makes it wrap around content then drag the buttons into it, it shows a bit of information over the mouse about where the button is going to be placed (Then shows green bars to indicate where the button is), mine doesn't do that and also it doesn't work at all. I'll include a gif of what I'm talking about.
Also, how do you enable the tooltips for the palette? and no I'm not talking about the quick docs but the mouse hover tip over the palette items.
Here is a gif https://gyazo.com/8a2bc1919f3d117238b7f52be11a2316
And also the error codes that pop up, one of them says view requires API Level 14 (Current min 9):<.GridLayout/>
And the other says
This Gridlayout view is useless (no children, no background, no id, no style)
Regarding dropping the button on the Grid... just drop the button on the GridLayout on the component tree (bottom left). Once you have the first item there you can use the grid as you'd normally expect it to work by moving the buttons around.
I realize that this question is a tad old, but also that it comes up quickly in a google search, so I hope that my solution can be of help to some one.
I was going through this same tutorial, and while I was never able to figure out if it's possible to enable the green lines or drag and drop properly into a GridLayout, I did find how to do it explicitly in the XML file.
In the tag for your button, simply add:
android:layout_row="X"
android:layout_column="X"
where x is any (positive) integer number from top to bottom for the row value, and left to right for the column value.
A less than ideal solution I know, but hopefully some one will benefit from this.
I have only one button in my layout which covers the whole screen (both height and width are match_parent).
But the button is not clickable everywhere. There is a rectangle(or an area) in the middle which is unclickable, so the button is only touchable on the edges of the screen. This certain layout is for a fragment. The fragment is in a ViewPager as the main screen with another one, which works properly.
I'm desperate, I replaced my complex source code and my xml, to get rid of the bug, but it still exists. What should I check? What are the possible reasons why the bug only shows up in a real device, and in the emulator works correctly? Frankly I don't even know which code should I attach..
I have designed a menu that consists of a few buttons in several different LinearLayouts all placed over an animated GLSurfaceView within a FrameLayout. When the user clicks a button in the interface, I set the current layout's visibility to GONE before making the next layout VISIBLE When the user selects a level, then game play starts and all layouts are GONE (apart from a control bar on the right of the screen, but that is not contained inside the FrameLayout)
On most phones the menu works like a charm, but I did a quick test on an Xperia Ray only to find that I couldn't go anywhere because the buttons wouldn't click. I have Log.d tags set up in most of my onClick Listeners, and in this case they aren't showing in the Logcat so it doesn't seem like the Listeners are firing at all. I also noticed that the GLSurfaceView wasn't returning anything from it's own TouchEventListener. Even though the functions triggered by tapping the GLSurfaceView are disabled while on the top menu, I normally still get a message in the Logcat.
I thought it could be something to do with the way I have used the FrameLayout. The documentation says it should only have one child, but another article I read on android developers demonstrated captioning images by displaying text over ImageViews inside a FrameLayout.
On a final note, I'll also say that I've tested in the emulators and I found that both android v2.3 and android v4 display the same behaviour as the ray. Currently those are the only ones I am sure of, aside from android v2.2 which runs my app perfectly. I am hesitant to trust the results of testing on the emulators.
I am personally stumped seeing as there is no error message to go on, but can anybody suggest a solution?
I found the solution.
Turns out that I had a stray ScrollView hanging around in my layout that was both above my root layout in z-order and visible by default. Instead of toggling the visibility of this view, I was doing so for it's child layout. Oops.
On most devices I have tested on, the stray ScrollView has not effected the functionality of my app, probably because the empty layout was allowing buttons behind it to be clicked. However it turns out that some devices, such as the Xperia Ray, are a little more strict on whether clicks can be passed down through layouts (possibly a performance decision).
The ScrollView was a required part of the layout so I couldn't just remove it. Instead I gave the the android:visibilty attribute to the ScrollView so that it would be GONE until it is needed by the interface and it won't block the user from clicking buttons.