Questions tagged [xml-layout]

Android uses xml files to layout its components on a window.

Android uses xml files to layout its components on a window.

187 questions
6
votes
2 answers

TypedArray not working

I'm learning about custom components and i'm having some trouble with custom xml attributes.My custom component extends LinearLayout and in the constructor(public Custom(Context context, AttributeSet attrs))i'm inflating a xml layout(2 Buttons and 1…
user
  • 86,916
  • 18
  • 197
  • 190
5
votes
0 answers

Update to Constraint-Layout 2 destroys working layouts

After updating com.google.android.material:material and androidx.constraintlayout:constraintlayout from 1.1.0 and 1.1.3 to 1.3.0 and 2.0.4 my layout gets squished. I've got a custom view constraint-layout inside a ScrollView->LinearLayout. The…
proc
  • 300
  • 3
  • 16
5
votes
1 answer

Placing an image on the top left of another image using Constraint Layout

I'm trying to place an icon top left of an image using Constraint Layout but it needs to be offset from the center of its sides. Like in the pictures: This is what I've got so far: This is the end goal: and this is my xml file:
devB78
  • 11,894
  • 3
  • 14
  • 14
5
votes
2 answers

Enabling both errorEnabled and passwordToggleEnabled in a TextInputLayout

I want to set both errorEnabled and passwordToggleEnabled to true in a TextInputLayout, but it seems that these two can't coexist because the one covers the other like this. I want to do this because I'm validating the password field to match a…
5
votes
1 answer

log4j2 with XMLLayout How To?

There are very less info on the web for log4j2 with XMLLayout. I have not found any links with simple examples (log4j2 + XMLLayout); Can somebody post a simple example of the same .... with regards Karthik
N.S.Karthik
  • 485
  • 13
  • 29
4
votes
1 answer

How to make a rolling news banner on android?

Possible Duplicate: marquee text in android in my app i want to have a news banner with the words moving to one side like tv .. i don't really know how to run that kind of animation .. and should the banner be a TextView ? i'm not really sure of…
Andrew S.
  • 58
  • 1
  • 5
4
votes
2 answers

How to design Chips layout for long text

I want go design chip layout like below. When Text is short enough to fit withing the layout I want to view like this. When Text is too long to fit in I want it display like this and animate text horizontally. Is it possible to design a layout…
4
votes
1 answer

How to stop Android navigation drawer from opening automatically?

How to stop the navigation drawer in my Android app from opening automatically? It used to work fine. Out of sight at first and able to be swiped into visibility. But I needed a title for it. At first it was only a ListView. Soon after modifying…
Alyoshak
  • 2,696
  • 10
  • 43
  • 70
4
votes
3 answers

Android: showing snackbar when toolbar is showing

This is whatsapp when you are not scrolling upwards. The toolbar is showing and so is the tablayout underneath it. SCREENSHOT1: This is whatsapp once you are scroll it up. You can see that the toolbar is hidden. SCREENSHOT2: There is a guide to…
4
votes
1 answer

Android pass parent view's 'pressed' state to child views

There are many question here on SO asking for a way to prevent a child view from copying its parents pressed or selected states. However, I'm asking for the other way around here :) - I've seen a very weird behavior in one of my apps: When running…
CodingMeSwiftly
  • 3,231
  • 21
  • 33
4
votes
5 answers

Eclipse - ADT plugin not auto-completing xml

I am only getting autocomplete in my xml layout when i type "android:" I want to get it whenever I press cmd+space. I am using a mac
user1163234
  • 2,407
  • 6
  • 35
  • 63
4
votes
2 answers

How to put Three imageview buttons on same line in Android

I have three imageViews There I want to set all these ImageView into one line. I have pasted my current xml code below.
VenushkaT
  • 1,152
  • 2
  • 19
  • 42
4
votes
1 answer

Creating multiple sections in one frames and make every section to work singleton

I have been working on an application similar to Pic Frame, Insta collage Some how I have succeeded to perform this task and created code to make frames like this i have used a Multitouch view class which is MultiTouchview class import…
3
votes
3 answers

How to have rounded corners with repeat?

I am trying for repeat for buttons. I am able to get repeat for regular background type. But i was not able to find right, left and center using the repeat xml file. If you know some solution with the xml file please help me. Thanks in advance The…
arnp
  • 3,178
  • 6
  • 26
  • 43
3
votes
1 answer

How to customize spinner box?

I want spinner as dropdown like below images, I created below like this xml layout:
demo
  • 672
  • 3
  • 9
  • 34
1
2
3
12 13