Posts

Showing posts with the label android-layout

what is ems and why the editfield size is same (width)?

what is ems and why the editfield size is same (width)? I just started android development, so I have two question in my mind First, why the size of edit field does not change its width . width Secondly, what is the meaning of these two lines android:layout_weight="1.0" android:layout_weight="1.0" android:ems="50" android:ems="50" When I used in layout form android:layout_weight= it take value as 0.1 , why ? android:layout_weight= 0.1 On field it take 1.0 , why ? what is ems ? 1.0 ems <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/login_header...

What is the Android Studio's Default Qualifier for Layout Resource Directory?

Image
What is the Android Studio's Default Qualifier for Layout Resource Directory? Creating a project in Android Studio with an Empty Activity would produce a project with an existing layout resource directory. If I create a project without an activity and decide to add an activity later, I'll need to create a layout resource directory to put the layout file in there. Before it's created it needs a qualifier. Is Android studio using any default qualifiers when creating an xml layout for the Empty Activity project? In the image below you can see the window where IDE is asking for the qualifier. You mean the name of the layout's directory? – st4rl00rd Jul 1 at 3:30 No, not the name of the directory; But the Qualifier for the layout's directory before it's created. This is the image of Android St...

Como resolvo isso? [on hold]

Como resolvo isso? [on hold] I am developing an apk in android studio and am breaking my head to solve this problem. So it's this: I have a resourse file layout that is a Dialog that I instantiate in my class and I do it as follows: final Dialog d2Builder = new Dialog(mContext); d2Builder.setContentView(R.layout.dialog_box_quantidade_do_produto); Objects.requireNonNull(d2Builder.getWindow()).setBackgroundDrawable(new ColorDrawable(android.R.color.white)); d2Builder.show(); Só que ao executar o meu apk, o meu Dialog aparece normalmente, porém fica uma linha em cima que estraga o meu design. enter image description here Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit...

Align a LinearLayout at the bottom of a RelativeLayout

Align a LinearLayout at the bottom of a RelativeLayout I have these nested layouts and i want to put a LinearLayout anchored to the bottom (internally) of the first RelativeLayout but i don't know how to do it. Can someone help me? I want something like this: https://imgur.com/eCCYS8Q <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#fff" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:orientation="vertical" android...