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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
35 views

How to disable shadows in LinearLayout in Android Studio

I have an activity which has a constraintLayout at the top and a FrameLayout that wraps a LinearLayout in itself. How exactly can I disable the shadows that the LinearLayout has at the top and bottom ...
schwitzky's user avatar
0 votes
0 answers
32 views

The components are moved after running the project

I have two problems: When running the project, the components are moved differently than when designed. I can't swipe the scroll view to see all the content. I'm a student and I encountered these ...
Nathan Diep's user avatar
0 votes
1 answer
23 views

TextView.text is cut mid width inside TableLayout TableRow

Main issue: text is squished so hard by View, so it gets cut. Key moments: TableRow is a child of LinearLayout so weight is supported. TableRow contains one TextView with android:layout_width="...
Alex Sukhobrusov's user avatar
0 votes
0 answers
9 views

Cardview height doesn't arrange for all items

Error image Hi, as you can see in the picture in the first element there is another 2 textview and their half is shown. For the second one since the detail section is 2 lined (sometimes it can be) ...
huseyincn's user avatar
0 votes
0 answers
17 views

Expand ViewGroup after adding children

I'm trying to add children to LinearLayout programmaticaly but LinearLayout does not expand more then screen size. However if I hardcode the height - then it is created more then screen size. But I ...
Bitlejuce Do's user avatar
0 votes
0 answers
12 views

Adding textviews inside Linear layout

How can I do something like this, I have been trying to add texts inside a linearlayout ensuring the second textview in the Linearlayout starts from the end of first textview however I don't know ...
Danielkenny's user avatar
0 votes
1 answer
47 views

The app is rendering diffrent on my phone while looking fine on the emulator [duplicate]

I created an app in Android Studio, and the UI on my phone is different from the UI on the emulator. I checked many different emulators similar to my phone, and the UI is looking good on them. The two ...
Kfir Arnesty's user avatar
0 votes
1 answer
59 views

Android studio java containers/linearlayouts

I would like to add multiple buttons with textviews left to right in the same row and normally would set the orientation to horizontal for this but I need the vertical in order to place the textview &...
Brett Hudson's user avatar
0 votes
1 answer
26 views

Divide space in LinearLayout depending on contents

I'd like to make myself a ListView with rows showing the name and the price of some product horizontally aligned. I want to the price to get the width it needs and the name to wrap to a new line if ...
Walter's user avatar
  • 37
0 votes
0 answers
38 views

Adding N number of textview dynamically inside view holder item while the recyclerview is setting up

In this part of my app, I am trying to add n (number) of textview based on number of orders to the linearlayout inside recycler view item, but the problem is textviews some times not showing, and I ...
Dr Mido's user avatar
  • 2,474
1 vote
2 answers
42 views

How to place imageview on the right end in the linear layout horizontal orientation

Code:(Image Attached)I am using LinearLayout and gravity and weight is not working for me in this case.[![enter image description here][1]][1] I want to place heart icon at the right end of the row. ...
Riya's user avatar
  • 49
0 votes
3 answers
45 views

Placing an image at a fixed position on a background in Android Kotlin

I have to develop the design as attached below. For achieving it, I created 2 separate linear layouts and given them layout_weight of 1 so as to divide the screen vertically into 2 background colours. ...
Frosted Cupcake's user avatar
0 votes
2 answers
23 views

How to adjust buttons properly inside LinearLayout if text on first button is more then half of screen

I am working on a layout file which have one parent LinearLayout and inside it two buttons and goal is to adjust buttons alignment according to the text size of buttons for an example if text size of ...
Kapil Rajput's user avatar
  • 11.5k
0 votes
0 answers
22 views

How can I add text below my carousel image? I used View Pager for the carousel

This is what I have now <androidx.viewpager.widget.ViewPager android:id="@+id/carouselContainer" android:layout_width="match_parent" android:layout_height="200dp" ...
David Gabriel's user avatar
0 votes
0 answers
13 views

Problem with placing of views inside a linear layout

So i have tried to place the imageview to the left with gravity but this doesn't work also i have tried to put it to the left with weight but that also did not work. I want to place the profile ...
Fratsie's user avatar
  • 11
0 votes
1 answer
28 views

Unable to minimize the gap between two adjacent buttons in a Neumorphism layout

I am currently working on a mobile application where I have implemented the Neumorphism design using the com.github.fornewid:neumorphism:0.3.0 library. In my layout, I have a requirement to display ...
Sidharth's user avatar
0 votes
0 answers
55 views

Android how to show the toolbar above keyboard

I'm working on my app that I have created a toolbar to show at the bottom of the screen now I want to move the toolbar above keyboard whenever the keyboard is show. I have tried the following ways but ...
chris oojer's user avatar
-1 votes
2 answers
52 views

In Android studio, how to place 4 circle views at equi distance from each other percentage wise (linear or relative layout)

In Android studio, I want to place 4 circle views at equi distance from each other percentage wise (linear or relative layout), so that distance from each other and left wall and right wall, all will ...
Naresh Pradhan's user avatar
0 votes
1 answer
50 views

How can I add a fragment to the top of a vertical linear layout on Android?

Currently, I'm adding a new fragment (Post) to a vertical linear layout (that is inside a scroll view) like this: val post1 = Post() supportFragmentManager.beginTransaction().add(vb.svLayout.id, post1)...
Created's user avatar
  • 87
0 votes
1 answer
84 views

Unwanted top margin on TextView with horizontal linear layout

Can Somebody explain why there is a margin above the textview with this layout? This seems like a bug to me. I can not find a way to remove this so that the TextView and Button start at the same ...
save_jeff's user avatar
  • 425
0 votes
0 answers
23 views

Why when i create item of my linear layout my app is ruined

Why button delete ruined my app So i built my app ToDo list in its one, i have MainActivity, which has toolbar and LinearLayout. //MainActivity package com.example.todolist import android.annotation....
Albert's user avatar
  • 1
0 votes
1 answer
21 views

Android ScrollView displaces other items

I tried all decisions from ScrollView not scrolling at all but my ScrollView doesn't work right yet. I tried to nest the TextView inside the ScrollView without the LinearView, to set android:...
AstFreelancer's user avatar
0 votes
1 answer
76 views

Center a button and a TextView with ellipsis in Android

I have following code with a TextView and a Button and I want them to be centered. The problem occurs when the text is too long so it pushes the button off the screen even if I use ellipsis. I do not ...
user2327866's user avatar
0 votes
2 answers
26 views

How to align two items of an activity in one row on the left and right edges, respectively?

How can I align a RadioGroup and an ImageButton in an Android activity on the left and right sides respectively? I am to make one row in the top of the display so that in the left there are two ...
AstFreelancer's user avatar
0 votes
1 answer
31 views

How can I position elements below a WebView inside a LinearLayout?

I tried to create a fragment with a WebView which had a Button above and below it. The button above was displayed, but the one below is not shown. It's like the WebView is trying to take up all the ...
Adam Burley's user avatar
  • 5,696
0 votes
0 answers
77 views

How i can get all child LinearLayout in kaspresso

I have LinearLayout with child the same type And try get all child This example get one element: val text1 = KTextView { withParent { withId(R.id.linear_layout) } ...
Red Cape's user avatar
0 votes
1 answer
43 views

Android Layout and Filling in Available Space

I have an activity in which I've got two layouts that should mirror one another, with elements taking up available space, but also being pulled to the left and right - so that they sit to the left and ...
Fluffeh's user avatar
  • 33.3k
0 votes
1 answer
30 views

Programatically adding rotated TextViews around a circle in android (Java)

I'm making a game. In the game, I would like to display player names around a circle as if they are sitting around a table. I'm using vertical Linear Layout as the table and Constraint Layout as the ...
Atilla's user avatar
  • 1
0 votes
1 answer
22 views

How do I draw a linear layout over a relative layout?

My code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas....
user avatar
0 votes
0 answers
23 views

Remove padding/margin above Fragment in Leanback

I'm creating an app with Leanback's PlaybackSupportFragment. I want the LinearLayout and contents below it to be moved up so that the LinearLayout aligns with the top of the VeticalGridView. There is ...
KoolKeith's user avatar
0 votes
0 answers
51 views

Are 'dividerHorizontal' and 'horizontalDivider' same? (Android)

Are horizontalDivider and dividerHorizontal same? Android Developers: horizontalDivider: Default horizontal divider between rows of menu items. dividerHorizontal: Drawable to use for generic ...
The Amateur Coder's user avatar
0 votes
1 answer
192 views

Inside a CoordinatorLayout with AppBarLayout, how to set ScrollView or RecyclerView above an EditText that is fixed to bottom?

I need to use a RecyclerView inside a CoordinatorLayout with AppBarLayout. Below AppBarLayout, I have a RecyclerView. But, I would also like to fix a LinearLayout at the bottom of screen. The ...
user10659018's user avatar
0 votes
2 answers
109 views

Android - set max width for buttons in LinearLayout

I have 2 lines of buttons (in this example showing just one line, just to spare space), that's why I have main LinearLayout and then inner LinearLayout for each button row. <LinearLayout ...
Darksymphony's user avatar
  • 2,272
0 votes
0 answers
20 views

Why set visibility not working for linear layout in view pager fragment?

I'm trying to control the toolbar visibility in viewpager from another fragment, but it's not working properly. I want to make the main collapsing toolbar hidden and view the second toolbar when the ...
Mahmoud Nabil's user avatar
0 votes
1 answer
432 views

Android: RecyclerView is not scrolling within CoordinatorLayout

I have custom LinearLayout which height can be set to maximum or minimum based on content it holds. But if there is RecyclerView inside this LinearLayout, onMeasure is still returning 0 when I call ...
martin1337's user avatar
  • 2,518
1 vote
0 answers
24 views

LinearLayout layout_gravity=right|end does not right align item [duplicate]

I have a very simple layout that isn't working properly and I am stumped! The ImageView should be aligned to the right of the layout. Here it is --> <?xml version="1.0" encoding="...
user1743524's user avatar
0 votes
2 answers
40 views

The problem of the joint arrangement of two TextViews with a large volume of text

There is a horizontal LinearLayout in which 2 TextViews are located. The problem is as follows: if there is a large amount of text in the first TextView, then it completely overlaps the second ...
Vladimir 's user avatar
0 votes
1 answer
40 views

How to make a Linear and a Relative Layout share horizontal screen space as percentages?

How to make a Linear and a Relative Layout share horizontal space as percentages? The LinearLayout on the left needs to have a percentage width of the screen, and the RelativeLayout on the right can ...
Alyoshak's user avatar
  • 2,696
0 votes
1 answer
52 views

Android Scrollview not scrolling (contains LinearLayout which enfolds a constraintLayout)

Hej, I am having my main activity layout in my android application, which contains a scollview. It's direct child is a linearlayout, which in turn holds a constraintlayout (it has constraint ...
Lampros Marantos's user avatar
0 votes
2 answers
69 views

How can I get round corners on a LinearLayout in Xamarin Android?

I'd like to know how to round the corners of my Xamarin Android Linear Layout. I have the following xml layout code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...
jho's user avatar
  • 197
0 votes
2 answers
76 views

How do I align a checkbox and edittext field side by side in android?

I am trying to make a checkbox and an edittext field side by side inside my LinearLayout. This is my code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
user avatar
0 votes
2 answers
69 views

How do I right justify a TextView in a Linear Layout?

I am trying to get the TextView, "tv_amount" to stay on the right side of the screen. I have tried using android:gravity="right" but that hasn't been working for me. Anyone have ...
Adam Lynn's user avatar
-1 votes
1 answer
72 views

How I go on a next line when the layout ends in android studio?

Currently I have a view that look like this: I have implemented to insert the view programmatically in a horizontally-oriented LinearLayout. And I don't want my last view item to be displayed like ...
Sabino di Tria's user avatar
0 votes
3 answers
63 views

TextView after ImageView in LinearLayout not rendering

I'm trying to create a LinarLayout which will contain 5 more LinearLayout as children, each having a weight of 1. So they will take the same amount of space on the screen. Now inside these children ...
Maifee Ul Asad's user avatar
1 vote
1 answer
74 views

LinearLayout of Activity doesn't update after AlertDialog is closed

With the following code I am able to successfully remove a View from a LinearLayout when clicking for a longtime on a button: button.setOnLongClickListener(new View.OnLongClickListener() { ...
Jade Kush's user avatar
0 votes
1 answer
46 views

How to create horizontal layout programmatically in java?

I have XML file where I display information using LinearLayout vertical. All what I need to do is to create horizontal LinearLayout and attach there an image and a TextView. Then I need to display ...
Timur's user avatar
  • 31
0 votes
0 answers
17 views

Adding 25+ textviews programmatically to 5 linearlayouts in numerical order

Here i have 25+ names and i have created 5 linearlayouts which have vertical orientation. <LinearLayout android:layout_width="match_parent" android:layout_height="...
Rakesh Bhagat's user avatar
0 votes
1 answer
102 views

URL image not showing up in Android Studio when using Glide

My activity is made up of 12 ImageViews. When the user clicks on one of the grid, I want to replace the default rectangular X image with an URL image. I have been trying to use Glide to set the image. ...
Shaun's user avatar
  • 23
0 votes
0 answers
142 views

LinearLayout does not respond to child height change in RecyclerView

I'm trying to achieve a expandable textview which allow user to expand our collapse text longer than specified lines. However, when the text is expanded, requestLayout of the TextView was called, but ...
Hhry's user avatar
  • 863
0 votes
0 answers
28 views

Collapse a View with a slide right/left to centre animation

I have a LinearLayout with orientation horizontal and I want to collapse all the views in linear layout with a slow Animation (1000 mili secs) that pushes the layout inward from left and right to ...
UMESH0492's user avatar
  • 1,701

1
2 3 4 5
100