Top margin not working from design view in Android Studio [duplicate] - android-studio

I am following this tutorial and am unable to make Box Three line up to the top of Box Two (which she shows how to do at around 1:45 in the video).
As you can see in the screenshot, I try setting the top margin to 0 but it has no effect on the layout. If I inspect the value again, I see that it has gone back to 16. I am really unsure what I am doing wrong here as I have been following the video quite closely. The tutorial is quite old from 2016 and I am using the newest version of android studio (bumblebee).
Screenshot of me setting the value to 0 but not having any effect on the display:
How can I make the margin 0??

This is a bug in the latest release: Setting marginTop doesn`t apply when using interface builder, only through XML code. That being said, the issue can be resolved, as you already figured out, by setting the value via 'Declared attributes' from the design view or by declaring the value in your code with
'android:layout_marginTop="0dp"' on your view.

In Box three set height as
android:layout_height="0dp"
then it will will start from top of box two top( both will be equal )

Related

After upgrading to Android Studio 4.1 why doesn't the text in my CheckBox controls display in runtime (but does display in design mode)?

Here's a snapshot of my app where you can see the running app which has missing text and you can see the text that should be displaying (which is properly displaying in design mode).
Why isn't the text displaying at runtime?
This only started happening when I updated to version 4.1 of Android Studio and rebuilt my app.
Additionally, here is how they are defined in the layout xml:
Here's a view of the layout details of the one checkbox that is not displaying the text:
Notice that it is showing text size in PT (points).
I changed it to sp after choosing from droplist and now it displays properly.
Not sure why this has always worked in the past and suddenly stopped working.
If it is a change I would expect an auto-update functionality when Android Studio upgrades the project.
Should Not Work In Design Mode Either
If it is a problem I would also expect it to display improperly in the Design Mode also. Instead it looks correct in design mode even though runtime doesn't display it. In this way I would've understood that I was using an incorrect unit.
TextView Also
I found that this was also happening in many of my TextView controls.

QGIS 3 - how to change size of attribute window?

When adding a new feature to a shape file in QGIS 3.4.4. the attributes dialog opens only as a tiny window regardless of the length or number of the attribute columns in the list. I can manually adjust the size of the window but when I add the next features it is tiny again. That soon gets very annoying when many features need to be added.
Here an example screenshot:
Is this a bug or can I somewhere change the settings so that the window automatically opens at an appropriate size? I am running QGIS 3 on MacOs High Sierra 10.13.6.
This is a pretty old post but I was having the same issue so I figured I would post how I fixed it. It might have been patched in later releases because I saw there was a bug report submitted.
I'm Running QGIS 3.8 on mac.
open layer properties, navigate to attributes form (icon below source fields). On the top left drop down menu change "Autogenerate" to "drag and drop designer"
This resolved my problem and the attributes form is full size. I had to repeat the process for all shapefiles I was working on.
default settings
settings to make it work

Android Responsive design using android studio

Hi all !!
I'm newbie to android, Can i get any solutions to make my android app layout that fits in all screens.
If there is any tutorial on it, that would be appreciated !!
Thanks,
Create the following folders in res and add the xml in that
res/layout-small
res/layout-normal
res/layout-large
res/layout-xlarge
And open it from studio layout and make changes.
this link helps you.
The Android resource system gives you the tools to provide alternate resources based on the available width, height, or smallest width — important measurements that serve as the basis for choosing when to change our UI based on the space available.
Width and Breakpoints
Width is perhaps the most important dimension when it comes to choosing when to change your UI. This is because width is the basis for the breakpoint system.
A very good example is here

How to stop other elements moving around when moving an element from relative layout in android studio?

I am new to Android Studio. I am trying to make a basic application that adds two numbers, but each time I move something around, The entire layout gets messed up.
I added a separate View in the center to act as a reference point to counter this, but it is still getting very annoying.
Any idea on how to fix this? I am using Studio version 2.1
If not, is any other way to design the user interface without having to deal with relative layouts?
I have tried linear layouts but those only allow me to place my elements in fixed places which I cannot use in my app.
Please guide me.
Note: I apologize if this question is too simple. I am a newbie after all, do forgive me.
Thanks in advance!
This is indeed the function of RelativeLayout in Android Studio. If you are getting problems with dragging and dropping with RelativeLayout then you should try any other layout. eg. ConstraintLayout
2nd Solution:
Try adding new buttons instead of copying and pasting old ones.
Have you tried using margin: http://android4beginners.com/2013/07/lesson-2-2-how-to-use-margins-and-paddings-in-android-layout/
also look you can align certain object in the xml code relative to eachother, have no link for that atm

Why can't I size android components at will?

Okay, so I'm really trying to do a lab for a class thing and I don't get why I can't have a textbox that takes up the width of the phone and a button that takes up the width of the phone on the bottom, but I don't know why that is? Here's a picture of what I have.
I know this is a noob question but it hasn't been addressed yet on the online course I'm taking and I really need an answer because I wanted android development to be as easy as .NET on windows.
Well anyway here is one picture:
Also here is the other picture:
Notice if I try to make one element bigger, it leads to it pushing the other one out of the activity, I want to have one activity with both elements taking up the entire width of the phone.
Does anyone know what I'm doing wrong?
EDIT: I'm using Ubuntu 14.04 not Mac OS X.
Your controls are children of a LinearLayout with android:orientation="horizontal". This means that the parent ViewGroup is aligning them horizontally; you cannot get the children aligned vertically in this configuration.
If you change the attribute to android:orientation="vertical", you will achieve the result you're looking for.
I strongly suggest getting yourself familiar with the default set of layouts available in the Android SDK by reading this official guide.
Edit : Please refer to this answer for placing views at bottom of the screen.
When you use a android:orientation=horizontal orientation in the layout, the views are stacked/placed in a single row. Since both your views have their width set to fill the screen, only the first one is shown/seen.
What you want is the vertical orientation. This places the views in a single column, one below the other. The width set to fill-parent will allow you the view to occupy all available space.
Official documentation on views : Layouts : Android Dev Docs
Understanding Android Layouts : Techtopia
Android Layout Tutorials : Learn-Android

Resources