Questions tagged [android-linearlayout]

LinearLayout is one of the basic layouts in Android. It arranges its children one after the another, either horizontally or vertically.

LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. You can specify the layout direction with the android:orientation attribute.

All children of a LinearLayout are stacked one after the other, so a vertical list will only have one child per row, no matter how wide they are, and a horizontal list will only be one row high (the height of the tallest child, plus padding). A LinearLayout respects margins between children and the gravity (right, center, or left alignment) of each child. More information about the layout:

4954 questions
1
vote
2 answers

ImageView in LinearLayout

I have two problems with this layout :
maysara
  • 5,873
  • 2
  • 23
  • 34
1
vote
1 answer

Why is my horizontal LinearLayout not reserving enough height for its contents?

I am working on an application that displays information about countries of the world (I'm learning with something real and I already have this data). Part of my layout is a LinearLayout which contains the country's flag and some basic information.…
Ian Leslie
  • 841
  • 1
  • 9
  • 25
1
vote
0 answers

white border depending of size of the image

I want to make a ImageView of specyfic height (1/3 of the screen) with white border and the image will be resize according to the height (to keep the proportion) for example. It will be perfect if also I will be able to add TextView below the image.…
1
vote
2 answers

Android Layout 3 Items With Different Widths In Same Line

I would like to know how I can put 3 different elements with different widths in the same line? Like below LinearLayout with Horizontal orientation (parent) within that, Textview(50% width-align left)ImageView(25% width-align right)Textview(25%…
joeldroid
  • 155
  • 1
  • 9
1
vote
3 answers

How to achieve a layout in Android studio with two Layouts

I am trying to achieve the below layout but I am not sure how I can split / have two layouts on one screen, with one being empty and one containing other elements. Like shown in the image below, I want to have layout 1 that contains other elements…
1
vote
1 answer

Android: How to cover the whole layout by a view programatically while the layout contains buttons already?

I've a linear layout filled by buttons(view1 - view5). I would like to add a view(red star) to this layout and I want this red star to cover the whole layout and its buttons (without setting the visibility of them) in the attached image: 1 - the…
Maor Cohen
  • 936
  • 2
  • 18
  • 33
1
vote
1 answer

Replace Recyclerview with LinearLayout

i am having a small problem with memory when i tried to used nested RecyclerView and it crashed because it was not recycling views and as a result it run out of memory. So i have to go with another solution. I have created my own layout which…
Random Guy
  • 560
  • 1
  • 5
  • 11
1
vote
1 answer

create customise button with image at top and text at bottom

i am referrring this link , but it dosent help Source code
1
vote
1 answer

LinearLayout inside card view cannot retrieved

I am using ListView with BaseAdapter. In tablets only, I cannot get the view of the LinearLayout(which is inside a CardView) in getView method of the BaseAdapter. if(convertView == null) { convertView =…
1
vote
3 answers

Add LinearLayout below listView

I trying to add a LinearLayout under the listView but it has a space between ListView and the LinearLayout.How to remove it ? Thanks a lot.
AI.
  • 934
  • 2
  • 14
  • 30
1
vote
1 answer

Dynamic Inflated View to determine the position

I have dynamically created a LinearLayout which contains an EditText and one Add Button. Depending upon the Web Service, the LinearLayout may have 2, 3 or etc. buttons. For the better understanding, let's say I have 3 dynamically inflated…
1
vote
2 answers

Change the visibility of dynamically created Layouts in onBackPressed

I need one help , I have dynamically created Linear Layout , i have to change the visibility of the Created Linear Layout. My Effort show far : for (int i=0;i
1
vote
2 answers

Button layout with 4 separate "borders": Can't get text in center

I have created a button layout with 4 separate "border" views (left, right, top, bottom) and alpha-numeric text intended to be in the center. I using the 4 separate border views so I can selectively hide (or not) each side. When used in a grid…
1
vote
1 answer

Is there a way to completely eliminate padding in a LinearLayout containing buttons?

I tried the following to try to display two buttons in a horizontal linear layout, with the edges of the buttons flush with the border of the linear layout. To my surprise, I found that there is always still padding between the buttons and the…
Julian A.
  • 10,928
  • 16
  • 67
  • 107
1
vote
1 answer

Custom ListView adapter Force close :(

I am a newbe to android and have been following the tutorials posted online to experiment with coding for android. I am trying to display a list which has input from two different arrays, but every time i run the code i keep on getting a force close…
ozzi
  • 11
  • 2
1 2 3
99
100