Android Studio 3.3, Layout Preview, Zoom In, Zoom Out and Zoom to Fit Screen buttons not working - android-studio

When I open an activity layout on Layout Preview, I want to zoom in but when I click to zoom in button nothing happens. Also, zoom out and zoom to fit screen buttons not working.
What I tried:
Updated Android Studio to version 3.3.
Done all Android SDK updates.
Updated NDK.
Clean Project.
Rebuild Project.
Create a new project.
How can I fix this problem?
Edit:
I think I found the solution. If your zoom level on 24%, zoom in and zoom out buttons not working. To fix the bug, lower layout preview window size till zoom level become 23% and lower. After this, zoom buttons starts to work again.
Screenshots:
https://prnt.sc/mgkphw |
https://prnt.sc/mgkpxu

It is a bug in Android Studio; at some zoom levels (e.g 24% or 9% or whatever) the zoom buttons stop working. One fix is to keep changing the 'Device for Preview' type and find the one on which zoom buttons work.
But the best fix that worked for me was to minimize all the tools on the bottom, i.e Run, Logcat, TODO, Terminal, Build and more ... Then the zoom buttons start working. Even you open the tools back again, the zoom will keep working.
Just to verify the solution; re-open one of the bottom tools (e.g Logcat) and click 'Zoom to fit screen (ctl+0)', most likely the zoom buttons will stop working again. Simply minimize the tools again and it's fixed.

Related

How to use "pan screen" on Android Studio?

I have found a function recently in Android Studio named "pan screen". It is located at the right side of design window. But I didn't find any description for it.
If you zoom in your design much enough so it no longer fits on in your design area in Android Studio, you can hit pan icon and drag your design around.
The image you have shown in is Zoom and Pan Controls which allows you to zoom in and out of the design , Now the Pan button will help you to pan around to find the areas
that are unable or not visible to see when zoomed in.
Pan is swing in a horizontal or vertical plane, typically to give a panoramic effect or follow a subject.
Pan in Android studio, you can hold space bar and drag the screen to view those area currently is not visible.
When a user zooms in the layout so much that you are unable to see all items in the layout, you can click on the pan option and then afterwards move the layout without accidently moving the items in the layout.

Why does Android Studio never show layout decorations when I open it?

As you can see in the image below, every time I open a project in Android Studio, the layout decorations option is deselected. How can I have it selected for default?
look on the top left of constraintLayout that you currently open, click on the eye icon and then click Show Layout Decorations. then you will be able to see it. but i don't know how to access it.
I think is not possible. I never see about that the solution

Tool bars are getting rearranged

I am using VC++ MFC and have the following toolbars in my software.
While working with different screens and software is minimized, if we disconnect the other screen, the toolbars get messed up after restoring the application.
Also that issue occurs, sometimes, when using single screen and change screen resolution or laptop lid is closed and re-open it, most of the cases when application is minimized at time we change anything.
We are not executing any code as such to draw the toolbars every time. While software is starting up, we read the toolbar positions from registry and create toolbars, and while closing application, we read the toolbar current position and save it back to registry.
Please suggest what should I do to fix this..
Thanks...
From the details what i can say is, while you were working on screen of one size the application considering the toolbar co-ordinates in relation to that screen. But when screen changes the old co-ordinates are no more valid as new screen may have different size and that's what causing the issue.

Android Studio (3.3.1). Layout decorations are not visible

Im learning Android studio now and encounter this problem with Layout Preview. I cant see phone frame.Ok, it's not big deal, but in result I see that the toolbar was not counted in design. For better understanding look at picture Virtual Device and Layout preview comparison. For layout preview and virtual device I picked Nexus 6. Screen sizes should be exactly the same. In the picture you can see the button in the layout preview. But in the virtual device the button is almost completely out of the screen bounds.
This is a link to my app
HelloWorldApp
WORKS!!!
Click that 'eye' icon and select the 'Show layout decorations'. Done.
Try this,
Click on Preview-> Visibility Symbol which named as view options
There is one option, Show Layout Decorations , Select this options.
For reference find below image:
I hope its work for you.
You can try to select device and theme for your preview window see attached image
https://i.stack.imgur.com/RB0QG.png
In the new version, you can see this feature in the 'layout validation' vertical bar on the right.

Virtual buttons not appearing on emulated Android 4.2 system

I have created an Android 4.2 AVD. For the need of my current project, the main screen orientation is landscape. The software keys option is selected.
The mode is set to xhdpi, like a Galaxy Nexus phone.
As I start the emulator, I see a black stripe on the right where the buttons should appear, but it remains black. Thus, there is no way to trigger a Back action since the emulated physical keys are disabled.
The problem can be fixed by configuring the emulator in portrait mode then rotate it once started; the buttons appear as expected. This causes problems since the window is automatically scaled down to fit on my monitor; I did not find any shortcut to restore 1:1 scaling at runtime, after the rotation is done. This is important since I would like to see pixel-perfect results.
I am using SDK version 21 and platform-tools version 16.0.2, as updated yesterday.
Found the solution myself... this is a workaround that allows getting 1:1 scale and the software buttons working.
Leave the AVD (Galaxy Nexus or cloned from it) on portrait mode.
Run the emulator from the command line, using the -scale 1 option; this is the magic that forces 1:1 pixel perfect ratio even if the window does not fit in screen at startup. By default, automatic downsizing happens to fit the monitor.
Rotate the display using Ctrl+F11 or Ctrl+F12 to get landscape mode.

Resources