Most voted "android-layout" questions
A layout defines the visual structure of the user interface. Normally declared in XML files, they are used by Activities and Fragments to interact with the user.
Learn more…699 questions
Sort by count of
-
3
votes1
answer487
viewsFragment is not overriding the marked layout
I’m working on a college project and I’m having a hard time replacing a given layout by a fragment. What is happening is that, the fragment is not replacing the layout of Activity but yes, mixing…
-
3
votes1
answer7071
viewsWhy is the error "This view is not constrained ..." in Constraintlayout?
What is the reason for this mistake? This view is not constrained, it only has designtime positions, so it will jump to (0,0) unless you add constraints XML <?xml version="1.0"…
-
3
votes1
answer2285
viewsWhat is the best method to create forms in Adroid?
I am creating a registration form, to add and edit SQL records. I found a place that indicated to do through ScrollView, so that the form has a scrolling, and in my case it would be really…
-
3
votes1
answer2462
viewsAdjust Image/Bitmap to Imageview or adjust Imageview to Image/Bitmap
I’m trying to create a menu screen something like this: To make this cut diagonally, I made this image to stay on top of the background: However, in Android Studio, I can not resize the image to…
-
3
votes3
answers2244
viewsPosition Button in the center of a Linearlayout with layout_gravity
I’d like to know why I can’t center the button, I’d like to center vertically and horizontally, but it seems to center only center horizontally in the vertical layout and vice versa. <?xml…
-
3
votes1
answer355
viewsRun Html5 inside Webview android
I have a page in Html5, where I would like to open it in Webview android, but it seems that Webview does not interpret javascript. There is a better Webview? See my code: Mainactivity package…
android html5 android-studio android-layout android-activityasked 5 years, 6 months ago Tiago 2,377 -
2
votes2
answers5433
viewsHow to finish layout Android App?
How it is done to customize the layout of an Android application. I have seen Apps so well finished and wanted to learn how to give such refinement to my Apps. The App Toshi Finance is a good…
-
2
votes2
answers694
viewsRunning on Multiple Screens
How to define a layout to run on multiple screens without creating multiple Layouts? It is possible or would have to create specific Layouts?
-
2
votes1
answer276
viewsAdd Elements Programmatically
I have a certain part of an application in which there is a random questionnaire. Generated by the user himself. The point is, I don’t have access to the amount of questions or what the questions…
-
2
votes1
answer327
viewsAndroid: Improper layout change due to animation
Guys, I have a problem here and I’ve posted on international stackoverflow, but no one answered me, so I’m posting here to see if you have any charitable soul to help me. Come on!! I simply wanted…
-
2
votes2
answers1429
viewsImage layout dynamically after photo is captured
How do I create a layout exactly like this (The layout is equal to both left and right): I’ll explain how I intend to do this and if possible help me because I don’t know how to do it this way: I am…
-
2
votes0
answers156
viewsDrag and Drop similar to the android shortcut screen
I’m using Android 4.0 to develop, I need to develop a drag and drop in my app and I will like to do as the shortcuts screen, a table 4x4 on the screen. With this the elements will have 16 defined…
-
2
votes1
answer149
viewsPrevent animation from repeating when changing the orientation of the device
I’m working on a screen that contains an animation that is repeated every time the screen is rotated. I searched but found no precise information of what I need to do so the animation does not…
-
2
votes2
answers77
viewsHow to leave the fields with the same style?
I don’t like to keep repeating code and I believe there is a way to leave, for example, two fields or more with the same style of formatting: Down below I got two EditText they have something in…
-
2
votes0
answers592
viewsProblems with Gridview (Android) to display data
Personal I am new to programming for Android and I have a problem regarding a situation in an application I am developing using Gridview with an Adapter class and a list of items(object) coming from…
-
2
votes1
answer1368
viewsChange the color of the tab indicator on Android
I have tried in many ways to change the color of what they call "tab Indicator", but without success... Even using the "Android Action Bar Style Generator" the color of this indicator remains light…
-
2
votes1
answer227
viewsError when customizing a menu using actionLayout
I was using to customize my menu items the actionLayout attribute but, the following error occurred: Layout menu_item.xml: <?xml version="1.0" encoding="utf-8"?> <TextView…
-
2
votes1
answer278
viewsHow to go to the top of an Activity on Android
I am developing a Java project for Android that is a Quiz and every time I go to the next question I visualize the radio Buttons and would like to position the screen at the top, so that the user…
-
2
votes1
answer2332
viewsRefresh activity after swiping your finger on the screen
How do I update the APP activity after the user swipes their finger down on the screen. How to detect this action to trigger an event in my code?
-
2
votes2
answers1667
viewsLeave photo rounded equal Whatsapp
I started a short time in the development area for Android. I would like to know what feature I use, in XML, to leave a rounded photo equal to a Whatsapp contact. I already use for some images the…
-
2
votes1
answer481
viewsHow to create APP-like clock layout
Good morning to you all. Could someone give me a help on how to create a layout similar to the Android clock APP? I would like to do something very similar with these screens. If you can help me…
-
2
votes1
answer573
viewsTabs on Android
I’m trying to implement a simple code just to show two tabs on Android and later add a content dividing into two activities, one to show examples with IF and the other with SWITCH. I created the…
-
2
votes2
answers130
viewsVideo view overlaying another Video View on Tabactivity Android
I have a TabActivity with two Tabs, both have a VideoView (Man|Woman). When I start one of the Tabs and then switch to the other, the video of the first still running underneath the other video. How…
-
2
votes3
answers2056
viewsLayout for all screen sizes
I just started messing with android and I came up with a big question. How I make a layout to work in all screen sizes? From what I’ve searched, there are specific layout folders for each size. So,…
-
2
votes1
answer3167
viewsHow to add an edge to a Textview per code?
I am making a dynamic form and would like to add an embroidery around a set with a Textview and an Edittext as in the code below: TextView tv = new TextView(this); tv.setText(vet[0]); EditText et =…
-
2
votes1
answer57
viewsAndroid Layout (Box Dialog)
I’m trying to build a boxdialog for a listview. I’m having trouble finding an example to base and develop my solution. Does anyone know any material I should know about? Here is a picture of the…
-
2
votes1
answer132
viewsHow to use View Animation
I’d like to know how you would use View Animation ,to simulate a GIF. For example: I have a picture of a sword, this sword is up, so do something like it goes right, clockwise,going around and going…
-
2
votes1
answer422
viewsDeveloping layout for various types of mobile resolutions with Cordova
I am developing the layout of an application developed using Ordova, however I would like to know how to develop for the various types of resolutions that exist in mobile devices, would have some…
-
2
votes2
answers336
viewsMulti-device layout display problem
I’m having trouble putting together a layout. In emulated it stays the way I want as below: But in the cell phone is completely disfigured as below: XML code: <?xml version="1.0"…
-
2
votes1
answer971
viewsLayout alignment between classes - Android Studio
I am implementing a program that uses database and interacts by differentlayouts registration and user editing. I’m working with RelativeLayout on all screens. On one of thelayouts, I insert a…
-
2
votes1
answer775
viewsCheck visibility of android keyboard
How do I check whether the android keyboard is visible or not? Some people say to calculate the difference between the size of the Rootview and its general layout of the activity, but for me, it…
-
2
votes1
answer5160
viewsMake a graphic in android studio
Good afternoon, you guys. I’m starting programming on android and wonder how I can build a chart like this: Is there a widget I can drag or do I have to write code? P.s I use android studio…
-
2
votes1
answer137
viewsParameters via xml for custom Imageview
I have a ImageView customized, which will function as a Switch. On the screen, I will have several of this item, but of different colors. I wonder if it is possible to pass a color parameter in the…
-
2
votes1
answer368
viewsAndroid theme support (Themes) in custom components, using Appcompat-v7
I started using the Appcompat-v7, for use the concept of Material Design in my project. Only now I realized that my custom components even inherited from native components, are not applying the…
-
2
votes3
answers552
viewsHow to convert pixel to dp?
I made an application that is a form, and I did everything via code without using xml, so my textViews and Edittexts were in pixels. No tablet works well, but mobile with smaller resolution was all…
-
2
votes1
answer1127
viewsImageview - Defining Drawable by path
Hello I’m starting on Android and I’m with a small project that would be a memory game. So to "shuffle the cards" I created a function that stores in an array of integers called codimg numbers from…
-
2
votes1
answer349
viewsSnackbar with Action Button not aligned to text
Hello, I wonder why my Snackbar doesn’t get the text aligned with the ActionButton, this happens only when the text is too long. I am placing an example image. Do you know how I make Snackbar to get…
-
2
votes1
answer174
viewsHow to know what "MATCH_PARENT" will look like when the view is drawn?
I’m using this code: LayoutParams par = new LayoutParams(40, LayoutParams.MATCH_PARENT); The second paramentric, the LayoutParams.MATCH_PARENT which represents the height is the size of a horizontal…
-
2
votes1
answer435
viewsHow to place border on a selected item in Listview?
How to place a border on a Listview item when the user selects that item in the android app?
-
2
votes2
answers3769
viewsSelect theme in Android Studio
When I select a theme in Android Studio, like this Holo I changed, it changes the preview but when I run the application on my device does not change anything. Anyone can help ?…
-
2
votes1
answer132
viewsHow to implement Actionbar and Viewpager as in Tinder
I need to implement a ActionBar and ViewPager as in Tinder. When Tinder opens, you can slide through all the tabs. The second tab is a ListView or a ListFragment and when you touch an item, it is…
-
2
votes1
answer325
viewsLayout distortion in Bluestack
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"…
android android-studio android-layout responsive-layoutasked 9 years, 5 months ago Gabriel Santana Bonatto 319 -
2
votes3
answers10546
viewsWorking with Navigation Bar (smartphone native) and Action Bar BACK buttons (added via Java)
I am Asking this question/answer to help those who may have/have/have some doubt regarding the buttons BACK that are extremely useful in our applications. I will use 1 and 2 to differentiate Action…
-
2
votes3
answers1934
viewsHow to use Scrollview + Listview
I am creating a profile system for users using ListView and RecyclerView and I’m failing to do the scroll work. Currently it works like this: When I don’t use the ScrollView, he just does the scroll…
-
2
votes2
answers1368
viewsHow to get the coordinates (X and Y) of a click on an imageview?
I’m making an application that has an image that occupies the whole ImageView, and when the user clicks at some point on that image, the X and Y coordinates corresponding to the image are obtained…
-
2
votes1
answer712
viewsForce keyboard opening
I have this dialog in my application public void alertaLocalizar(View v) { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view =…
-
2
votes1
answer1105
viewsAndroid - Align Layout above the keyboard
I have the following layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/view_login"…
-
2
votes1
answer313
viewsRecyclerview enviezada(diagonal) - android
I need to create a recyclerview, on android, whose items are uploaded, as per the image i tried to use a Shape on the background image but there is click problem. When I use Hape, clicking on the…
-
2
votes2
answers993
viewsHow to get data from a text displayed in the dialog
I am using this library to display dialogs in my application: https://github.com/drakeet/MaterialDialog With this library it is possible to display in the dialog a layout created, but I am not able…
-
2
votes2
answers235
viewsHow to create an application without a title bar?
I intend to create a web app with a WebView. How can I create an application without a title bar that isn’t fullscreen?