Set match_parent size for content's LinearLayout in TabHost (Android)

I can't understand, why LinearLayout with ID "map_tab" (first tab) not have a height "match_parent" in fact? I have a XML-file with TabHost:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout android:background="#ffff" xmlns:android="" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TabHost android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tabHost_main" android:layout_gravity="center_horizontal"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="match_parent"> <!--Вкладка №1 - карта--> <LinearLayout android:id="@+id/map_tab" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <!--Карта--> <HorizontalScrollView android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="match_parent"> <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/map_img" android:layout_width="wrap_content" android:layout_height="match_parent" android:scaleType="centerInside"/> </ScrollView> </HorizontalScrollView> <TextView android:id="@+id/sector_advert_text" android:background="#ddffaa" android:layout_gravity="bottom" android:gravity="bottom" android:layout_width="match_parent" android:layout_height="50dp" /> </LinearLayout> <!--Вкладка №2 - акции--> <LinearLayout android:id="@+id/stock_tab" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:text="2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <!--Вкладка №3 - Маршрут --> <LinearLayout android:id="@+id/route_tab" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:text="3" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </FrameLayout> </LinearLayout> </TabHost> </LinearLayout>

Set match_parent size for content's LinearLayout in TabHost (Android)

I already try to set height to "fill_parent". It's look like "wrap_content" always. If I set height of "map_tab" to 50dp, for example, it will not OK too! Second and third tabs have this problem too. What me do to make tab's content height "match_parent"?

-------------Problems Reply------------

I solved this problem! Just change:






Good luck! :)

Category:android Views:6 Time:2017-09-02

Related post

  • Setting font size for a DropDownListFor 2011-09-16

    I am trying to set the font size of the data inside a DropDownListFor. I can set the size for all the other text in the grid, however, I can't seem to control the text inside the DropDownListFor. <% foreach (var item in Model) { %> <tr>

  • What are the ways to modify the font in android and how to set exact size for the boldness in android? 2012-03-06

    I want to know What are the ways to modify the font in android and how to set exact size for the boldness in android text. --------------Solutions------------- I think that can be achieved by few ways, First you can set custom TypeFace to your Text w

  • Window set to size around content leaves gap on each side 2012-02-02

    Can someone please tell me why, even though I've set my Window to SizeToContent and my content is Width=40 does the app load bigger across the Width? The following example sizes to height, but the width is about 100 pixels (estimation). Thanks <Wi

  • Set window size for standalone application 2009-08-01

    I want to set the default window size for a flex application that runs with a standalone player. I set width and height to 100% to be able to get the ResizeEvent and being able to adjust the layout if the user changes the window size. But I'd like to

  • How to set custom size for cursor in swing? 2010-04-12

    I am using the below code to set a custom cursor for JPanel, but when i run the code its enlarging the image which i set for cursor. Is there a way to set a userdefined cursor size ? Toolkit toolkit = Toolkit.getDefaultToolkit(); BufferedImage erasor

  • BlackBerry programming - Setting font size for label 2010-11-04

    I'm trying to make the font on a LabelField the same size as the built-in digital clock on the Storm and Torch. No matter what I set the size too, it seems to only goto a certain size and it will no longer increase. How do I increase the font size /

  • How can I set a size for html.EditorFor helper? 2011-03-08

    What is the simplest way to set the size of the generated field? --------------Solutions------------- Using CSS: <div class="foo"> <%= Html.EditorFor(x => x.Foo) %> </div> and in your CSS file: .foo input { width: 200px; } You co

  • Setting font-size for dropdown in chrome does not seem to affect the styling 2011-04-14

    I set the font-size for the dropdown in chrome, but it does not appear to change the size of the <select> It works on FF - when i set the font-size as 15px, it is distinctively bigger --------------Solutions------------- Styling the "font-size"

  • Setting Maximum Size For ObjectContent Web API Preview 5 2011-11-02

    When I use the the ObjectContent object to create the HttpContent to send a request via HttpClient to a Web API service I am getting the following error: Cannot write more bytes to the buffer than the configured maximum buffer size: 65536 The followi

  • Set Maximum Size for CGImageRef from ALAssetRepresentation 2012-01-12

    I am currently using the following code to get an UIImage from an ALAsset in an iOS app. ALAssetRepresentation *rep = [self.asset defaultRepresentation]; CGImageRef ref = [rep fullResolutionImage]; ALAssetOrientation orientation = [[self.asset valueF

  • Set the size for a sprite image position within a background 2012-03-02

    I'm positioning a small image in the corner of the background of a div. I want to include it in a sprite but I'm not sure how to set the size of the image from the sprite. My only solution I can think of is to place the image on the absolute bottom r

  • Intellij IDEA 11.0.2, set tab size for custom file type? 2012-04-09

    I'm using a fully licensed version of Idea. I just created a custom file type for *.jade files. Generally, I use a 4-space tab-size, but for *.jade files, I want to use a 2-space size. That's it. I don't want a work around. I want to be able to set a

  • How to set fixed size for thumb of ListView? 2012-05-01

    I'm using custom thumb for ListView: using style <style name="CustomTheme" parent="@android:style/Theme.NoTitleBar"> <item name="android:scrollbarThumbVertical">@drawable/scroll_thumb</item> </style> but in application it look

  • How to set default size for published SWF in Catalyst CS5.5 2012-12-11

    I create a 800*600 pixel project in Catalyst CS5.5 and published it as .swf. But when I opened the published .swf, the default size is smaller than 800*600. I have to resize it by myself. So is there any method that I can set the default size for pub

  • Setting window size for DOS applications running on WindowsXP Pro machine 2013-10-05

    I have a couple old DOS based programs (QBasic, Flodraw) that I still would like to run occaisionally. The last time I used them was 2002, so I don't know what OS was running then. When I run the apps now the windows that open are not sized convenien

  • How do I set field size for the Number type when designing a web database? 2014-09-15

    I'm an experienced Access developer but this is my first foray into creating a web database using Access 2010. When adding a field to a table, I can select data type Number, but I can't find a way to set the field size (integer, single, etc.) for it.

  • How to set initial size for a dictionary in Python? 2009-08-19

    I'm putting around 4 millions different keys into a python dictionary. Creating this dictionary takes about 15 minutes and consumes about 4GB memory on my machine. After dictionary is fully created, queering the dictionary is fast. I suspect that dic

  • How to set variable size for List control item in Flex? 2010-06-17

    The following code display a list of comments using List control. The item height set to a fixed value (150), so it seems working: if the content is too long, the scrollbar shows... However, what I really want is not to set the height but let it to c

  • Setting maximum width for content in jQuery Mobile? 2011-10-29

    I have a jQuery Mobile webpage which currently has a width=device-width but my form elements (textfields and the submit button) stretch to the width of the browser when viewed on a desktop computer. Is there any way to set a maximum width so that the

  • ListView: how to set fixed size for the colum of the table? 2012-10-12

    i've a 'structure' on a Asp.Net ListView like this (it is an exctract): <asp:ListView ID="lvSchede" runat="server" DataSourceID="dsWrkCtrTable" GroupItemCount="1"> <GroupTemplate> <tr id="itemPlaceholderContainer" runat="server">

  • how to set fetch size for jdbc odbc driver 2009-09-25

    Im using sun.jdbc.odbc.JdbcOdbcDriver to connect to an oracle database.I know I would be probably be better off using the thin driver but I want the app to work without specifying the db server name and port no.My connection string is like jdbc:odbc:

  • How to set heap size for java environment manually? 2011-04-27

    How to set java heap size and check it manually? --------------Solutions------------- See this if you want to watch how much memory is consuming and more by your program, use jvisualvm.exe (t

  • How to set a size for JMenuItem? 2013-10-25

    As you can see, it's ugly to have these kind of JMenuItems. The width of the menu items is quite small. Here is the code: JMenu menuOne=new JMenu("MenuOne"); JMenu menuTwo=new JMenu("MenuTwo"); JMenu menuThree=new JMenu("MenuThree"); JMenu menuFour=n

  • Set exact sizes for brushes 2014-06-29

    Well, I tried to create an 'Idea' instead of a 'Discussion' and after filling out the entire form, writing it up and everything, the stupid Adobe Interface tells me I don't have permission to create an 'Idea' in this community!?!?!?! Adobe, if I can'

Copyright (C), All Rights Reserved.

processed in 0.181 (s). 11 q(s)