Android :: Create A Layout - Multiple Scrollable ExpandableListViews In A Vertical Linearlayout?
May 7, 2010
Any insights/pointers regarding creating a layout like this. I have wasted quite a bit of time on this. I want to create a vertical linearlayout which has multiple ExpandableListViews separated by TextViews.
CODE:.........................
I tried the following approaches but each of them has one shortcoming or the other:
1. Add TextView and ExpandableListViews to a linearlayout. The problem with this approach is that LinearLayout by default is unscrollable.
Adding the LinearLayout to a ScrollableView creates even more issues because ListViews handle their own scrolling behavior.
2. I tried using a single ExpandableListView to model the above layout but the problem is that setGroupIndicator applies to the entire ExpandableListView, not a specific group.
View 2 Replies
Nov 17, 2010
I have a registration form in a LinearLayout as shown below:When emulator screen is in it's default position it is working fine. But when I rotate the emulator screen it only displays the elements which are fit to screen and remaining are wrap up. As shown in below screen:Now I want to make this layout scrollable but not getting the idea.
View 1 Replies
View Related
Feb 25, 2012
One of my activities receives some data.I want to obtain a layout like the one for the "contacts" app, which has 1 contact on each row and clicking a row you pass to another activity which shows the details.
What do I need to create the "list" layout?
Are those rows simply TextViews or what else?
How do I generate the rows at runtime into the layout?
If it is too long to write down some code, just tell me what I need and I'll check by myself.
View 2 Replies
View Related
Aug 5, 2010
After I start the activity I am unable to scroll down to see other buttons and options in the xml defined below. Does anyone know how to make this scrollable?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:background="#000044"
android:isScrollContainer="true"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:text="@string/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"/>
<EditText
android:id="@+id/editTitle"
android:text=""
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/description"
android:text="@string/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"/>
<EditText
android:id="@+id/editDescription"
android:text=""
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/location"
android:text="@string/location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"/>
<EditText
android:id="@+id/editLocation"
android:text=""
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/startTime"
android:text="@string/startTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"/>
<DatePicker
android:id="@+id/DatePicker01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TimePicker
android:id="@+id/TimePicker01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/endTime"
android:text="@string/endTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"/>
<DatePicker
android:id="@+id/DatePicker02"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TimePicker
android:id="@+id/TimePicker02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/buttonCreate"
android:text="Create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
View 2 Replies
View Related
Aug 9, 2010
I want to implement an activity where the only thing you see is a big image, which can be scrolled horizontally and vertically.On Top of that image I want to display buttons, that can be clicked and trigger certain actions (like creating an intent to start a new activity). First I was thinking about a ScrollView, that has a FrameLayout as a child. The FrameLayout could have the image as a background and can have the buttons as childs. Because I know the position of my buttons exactly I could place them with absolute coordinates. Here is my first code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:layout_width="1298px"
android:layout_height="945px"......................
View 1 Replies
View Related
Aug 13, 2009
I'm trying to implement something very similar in my application, but looks like it's impossible to do this with standard components. I read several topics about such scrolling feature in the group, but all the topics ends with suggestion to write your own scroll view. I wonder did somebody implement such scroll view already? Or can somebody provide a brief how-to on this particular feature. I think any information on this would be very appreciated by many members of the group.
View 4 Replies
View Related
Feb 15, 2009
Eclipse doesn't seem to like the constant VERTICAL in the LinearLayout. Can you tell me what the problem might be. Here is a snippet of the code I have. I am using the latest Android SDK.
View 2 Replies
View Related
Jun 11, 2009
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Layoutbuttons"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Bsave" android:text="Save"></Button> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Clear" android:id="@ +id/Beditclear"></Button> </LinearLayout>
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/Ledititems" android:orientation="vertical" android:scrollbars="vertical" android:scrollbarStyle="insideInset" android:scrollbarAlwaysDrawVerticalTrack="true" android:fadingEdge="vertical" android:fadingEdgeLength="8px"></ LinearLayout>
</LinearLayout>
I am adding dynamicly created EditTexts to the last vertical LinearLayout:
ArrayList<EditText> arrayedititems; edititems = (LinearLayout) findViewById(R.id.Ledititems);
arrayedititems.add( new EditText(globalcontext) ); //multiple times to add many EditTexts .... edititems.addView(arrayedititems.get(lastindex) );
Now all the edittexts are being added fine and show up on the linearlayout, the problem is I get no vertical scrollbar and can not scroll the linearlayout (you can a see large number of failed attemptes in the xml entry to enable this scrolling, such as forcing scrollbars or setting to vertical) Do I need to call some sort of invalidate() or notifyDataSetChanged() like with an arrayadapter to update the LinearLayout into checking if it needs to enable scrolling?
View 2 Replies
View Related
May 6, 2010
I have an Activity which uses a layout with a LinearLayout in it. Now I want to create in runtime a subactivity which loads some other layout and add this layout as item of my LinearLatout.
View 1 Replies
View Related
Jul 1, 2010
scrollable meaning by the user touch he can can go up and down in the layout given this is what i did and the emulator throw an exception null pointer somthing and i have problems figuring out from where it comes ....
CODE:.........
it works can some one explain to me what's wrong ?
View 3 Replies
View Related
May 6, 2010
I'm trying to create a "scrollable" layout in Android. Even using developers.android.com, though, I feel a little bit lost at the moment. I'm somewhat new to Java, but not so much that I feel I should be having these issues--being new to Android is the bigger problem right now.The layout I'm trying to create should scroll in a sort of a "grid". I THINK what I'm looking for is the Gallery view, but I'm really lost as to how to implement it at the moment. I want it to "snap" to center the frame, like in the actual Gallery application.Essentially, if I had a photo gallery of 9 pictures, the idea is to scroll between them up/down AND side to side, in a 3x3 manner. Doesn't need to dynamically adjust, or anything like that, I just want a grid I can scroll through.I'm also not asking for anyone to give me explicit code for it--I'm trying to learn, more than anything. But pointing me in the right direction for helpful layout programming resources would be greatly appreciated, and confirming if it's a Gallery view I'm looking for would also be really helpful.EDIT: To clarify, the goal is to have ONE item on screen at a time. If you scroll between one item and the next, the previous one leaves the screen, and the new one snaps into place. So if it were a photo gallery, each spot on the grid would take up the entire screen size, approximately, and would be flung out of the viewable area when you slide across to the next photo, in either direction. (Photos are just an example for illustration purposes)
View 2 Replies
View Related
Nov 22, 2010
is it possible to make an entire linear layout scrollable when it needs to be? (when all of the elements in the layout don't fit on the main screen)?I know it is doable with views, etc.but is there a way to incorporate everything on the layout to be scrollable at the same time?Maybe scrollable is not the right term. basically - if one of the elements (a button in this case) doesn't entirely make it onto the main screen of the phone and I need to slide a finger down to access it if that makes sense.
View 2 Replies
View Related
Aug 3, 2010
I am trying to create a basic datasheet in my application using a TableLayout. The first row contains the titles of each column. Every row thereafter is data. I would like the data to be scrollable while keeping the first title row visible (i.e. the first row would not scroll with the rest).I have tried something like the following (unsuccessfully)
View 1 Replies
View Related
Mar 17, 2010
I'm getting started with OpenGL ES on Android and I'd looking to learn some techniques to have a game map larger than the visible area.I'm assuming I've somehow got to ensure that the system isn't rendering the entire scene, including what's outside of the visible area.I'm just not sure how I'd go about designing this.This is for simple 2D top-down tile based rendering. No real 3D except what's inherent in OpenGL ES itself.Would anyone be able to get me started on the right path? Are there options that might scale nicely when I decide to start tilting my perspective and doing 3D?
View 1 Replies
View Related
Nov 24, 2010
I have 3 text views in a layout, where the text clips a tad on the bottom on my droid 2...how can I ensure that the whole text is viewable and the user can scroll down (simply with their finger) to see the rest of my text?
EDIT:
CODE:..................
View 2 Replies
View Related
Jul 9, 2010
I want to show a list of items when the user clicks an overlay item on a map. The user should be able to select any of these items and edit them. The list can have many items (more than that can fit in one active screen) therefore it needs to be scrollable
View 1 Replies
View Related
Nov 7, 2010
On the emulator, I see the custom SurfaceView _map Object take up the whole screen, except for the EditText text-box at the bottom, right where it should be. When I run the same code, same everything, on my Motorola Droid, there is no EditText to be seen anywhere. I figure that I am missing something with the LinearLayout implementation I have. Until now, I've gotten off easy on learning how to use another API's layout manager.
Here's the code:.......................
View 1 Replies
View Related
Mar 23, 2010
How do I make sure my app is only for vertical layout? I added this android:screenOrientation="portrait" but that doesn't seem to do the trick.
View 5 Replies
View Related
Aug 25, 2010
I want the ability to re-arrange Views in a LinearLayout, without specifying specific pixel locations, at runtime. for my proof of concept, I have a layout with 2 TextViews, one red, and one black. The red TextView is on the left. I want onClick to set it to be on the right, without adjusting margins, as if I'd re-written the XML of the layout, with the red TextView second.
View 1 Replies
View Related
Nov 23, 2010
I am programatically adding custom views to a vertical LinearLayout, and I would like there to be some space between the views. I have tried adding: setPadding(0, 1, 0, 1) to my CustomView constructor, but this doesn't seem to have any effect. It was pointed out that I should use margins. Since I am dynamically adding views, I need to set the margins from code (not in xml). I believe the way to do this is below, but it isn't working.
public class MyView extends View {
public MyView (Context context) { super(context);
MarginLayoutParams params = new MarginLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.setMargins(0, 10, 0, 10); setLayoutParams(params);
I also tried using MarginLayoutParams as a parameter while adding the views to the Linear layout (as below). This also did not work:
MarginLayoutParams params = new MarginLayoutParams(linearLayout.getLayoutParams());
linearLayout.setMargins(0, 10, 0, 10); linearLayout.addView(view, params);
View 2 Replies
View Related
Apr 18, 2010
I am trying to layout 1 textview (upText) left aligned and 1 textview (downText) and an image view (image) both on the same line and right aligned.
How can I do that? I tried that, but both 'textview' and image view at left aligned.
CODE:....................
View 1 Replies
View Related
Jun 16, 2010
I want to set android:layout_centerVertical="true" property of layout through java code of an image.
How to achieve this. here is my code.
CODE:..................
I have tried using setScaleType(ScaleType.FIT_CENTER) but no use.
View 1 Replies
View Related
Oct 8, 2010
Kind of an newbie question, I suppose -- I haven't done much playing with layouts yet I want a spacer in a layout to space some text down below the "live" part of a background image.
View 10 Replies
View Related
Apr 8, 2009
I have played around a bit with the xml files for creating layouts and can't explain the behaviour of layout_weight when using it in a LinearLayout that has orientation="vertical"
When creating a layout that is horizontal everything follows the documentation, that a child would get more space if it's has the highest value.
But the following code for vertical orientation, give more space to the item with lowest weight.
CODE:..........
And the question is: Is this a bug or just a feature that maybe need more documentation?
View 2 Replies
View Related
Jan 21, 2010
I have the following layout, which is 1 icon on the left and 2 text views (stack on top of each other) on the right. I would like to have the text1 vertically center in the panel and when I make the text2 Visible.GONE. Can you please tell me how can i do that? code...
View 2 Replies
View Related
Aug 2, 2010
I have problem in scrolling of webview vertically when it's scrolled along vertically,where this webview is with in scrollview tag,how can i enable the scrolling for webview and to disable the scrolling of whole layout when its on webview contained layout.
View 1 Replies
View Related
Oct 8, 2009
Is it possible to create a horizontal LinearLayout where we specify how wide percentage-wise each element is? Something like:
LinearLayout ll = new LinearLayout(); ll.add(new TextView("a")); ll.setViewWidthAtIndex(0, 30); ll.add(new TextView("b")); ll.setViewWidthAtIIndex(1, 50); ll.add(new TextView("c")); ll.setViewWidthAtIndex(2, 20);
View 6 Replies
View Related
Sep 24, 2009
I try to create my custom view inside a linearlayout. For example
<View android:id="@+id/ViewPaint" class="com.example.android.helloactivity.HelloActivity$DrawingView"/>
In the java source I created a DrawingView class which extends View. Unfortunatly it does not get instantiated. I tried to overwrite the ondraw() but without success. Code...
View 4 Replies
View Related
Jun 19, 2010
I'm currently working on my first android application. I am using a tabbed layout for my application. I followed the tutorial for this on the dev guide and ran into a problem. The tutorial only used three tabs, but I have a need for more. As such, the tabs resize and bunch up. I was hoping someone could tell me how I can make them scroll, like in dolphin browser when using multiple tabs.
View 1 Replies
View Related
Sep 2, 2010
I have being playing around with expandable list views recently. I am trying to get a list view that has a checkbox as one of the elements of the child view.
I found this tutorial, http://mylifewithandroid.blogspot.com/2010/02/expandable-lists-and-check-boxes.html, and it seemed perfect. However when I compiled it and started playing with it I realised its very buggy. Checking a box in one group can cause a random box from another group to check or uncheck.,
This is the only tutorial I can find on this, It seems like a thing that would be used in a lot of apps, so I was wondering, is there any other good tutorial or resource out there that deals with this? Or even better, would anyone care to show their own code having gotten this to work...
View 1 Replies
View Related