How to scroll a scrollable layout in the Android Studio? - android

I've imported my Project form Eclipse into Android Studio and I can't find the way to scroll my scrollable layout in the program (of course I am sure it is scrollable - I can scroll in the Eclipse and on a device).

According to this change set: https://android-review.googlesource.com/#/c/61089/ , there is a fix for this coming soon. I'd hazard a guess you'll see the fix in 0.1.7.

The fix bkromhout mentioned only works if the ScrollView is the root of the layout. I had put mine on top of the default RelativeLayout and had to manually fix that in the XML before the GUI would give me the full view. I hope this helps others who did the same.

Related

Android Studio can't add elements to the layout

I'm trying to create my first app in Android Studio with Kotlin. The installation worked fine. However if I drag any element onto the Layout, it's not showing up properly. The only change I can see, is a little white dot, that appears as soon as the Layout contains any element. I can select it and view the element attributes on the right, but nothing more.
If I run the app, all elements are squashed in the top left corner.
I already reinstalled Android Studio.
Does anyone know how to fix my problem?
Thaks in advance!
Here is some more information:
XML Code,
Error messages
Make the constraint layout width and height as match_parent in text editor. and then try adding widgets in the design view.
Here is some more information:
XML Code,
Error messages

Android studio My app is displaying incorrectly.

I am trying to learn to make my own apps by following tutorials but i have an issue when i run the app in the emulator or on my phone. All theScreenshot contents of the layout are squished in the top left corner.
This is all the codescreenshot 2here. I am a noob so don't go to hard on me. Thanks
It would be better if you also post your layout code (activity_main.xml) here for this kind of problems. But I am guessing you are using constraint layout as root of your layout and its child views are not constrained vertically, so all of them go to another position in run time.
Maybe you are using a relative layout and no positioning is specified.
You should paste the xml's code

Blueprint view nor the constraints are now visible in Android Studio design view

I had to edit the Constraint Layout XML file by hand (*), so I also removed all the tools: fields from the XML. To my understanding these attributes are only used by Android Studio and the Constraint Layout tool. But I removed them because I wanted to reset the state of the layout and changing the android: properties for the Constraint Layout surely would only mix things up even more, right?
So I am now in a situation where the blueprint view stays empty and the hierarchy view says "Nothing to show". I see no view properties and no constraints. I can only see the flat UI design view of the layout, but I can't select any elements from it either.
Any ideas how to fix this?
I am running Android Studio 2.2.3 and Constraint Layout beta 4.
*) Why did I edit the layout by hand you ask? Well, I selected "Convert to Constraint Layout" in which case Android Studio just flattened my layout and hard coded the positions of all elements. Which wasn't exactly what I wanted since then I couldn't change the positions anymore. Removing the hard coded positions (and the tools: arguments) let me re-structure my layout.
Ok, I am going to answer this myself since I got it working thanks to Nicolas Roard who works on the Constraint Layout team at Google.
try pressing "r" [in the design view]
https://twitter.com/camaelon/status/809427379500126208
I wasn't aware of the keyboard shortcut "r" in this case, but it did solve it for me!

Cannot grab view and set any constraint in the new Constraint Layout editor in Android Studio

I would like to use the new Constraint Layout Editor in Android Studio but somehow I managed to build a layout I cannot edit.
Some views are overlapping and I cannot select the one I desire hence I cannot set any constraint to it.
The view is the 'green square' I would like to select. But there are 2 other views in the way.
Can I somehow 'lock' the not used, or already set views like the layers in photoshop or something...?
Screenshot:
Please advice any help.
My personal advice/"answer" to you would be to leave ConstraintLayout alone until it's been properly tested and re-implemented. I have wasted a number of days trying to get it to do what I want. My conclusion is that it's currently so buggy as to be unusable.
You might have to restart android studio and/or invalidate caches.

Recently Android studio 2.2 - Unable to drag views around in layout file

I updated to 2.2 literaly 30 minutes ago and when I tried to move widgets around in layouts,
this happened:
https://gyazo.com/d3c640cca6f212aaa9effe2db9bccb98
I can't center it or even move it to the right,center,etc. It's always stuck on the left.
What's wrong with it? any ideas? should I uninstall Android Studio and re-install it again?
You Should Post your layout.xml file here, But i think you should go and change the layout in the layout file from linerlayout to the Relative Layout .
Linear Layout puts widgets one after the other.
Relative Layout puts stuff or widgets relative to the other widgets on the page or the relative things like centre of the page or 5dp below another widget.
Hope it helps :)

Categories

Resources