relativelayout

remove extra real-estate from top of custom dialog

I created a custom dialog that I'm dynamically putting views into via a RelativeLayout. Every time the dialog is displayed, it shows all my child views just great, but it has some space at the top that I can not account for. I'm assuming this is reserved for a "title" of the dialog (which I won't have). Is there a way to remove that s...

How do I achieve the following result using RelativeLayout?

Pictures: http://img838.imageshack.us/img838/1402/picse.png How do I make the layout in Pic. 2 using RelativeLayout ONLY. Below is the xml layout of the first screenshot. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" ...

Defining a ScrollView without setting it's height

Hello, I created a ScrollView and want it to expand to the available space, without having to set a fixed height (i.e. "250px") for it. As such, I created a RelativeLayout. The basic outline follows: <RelativeLayout> <LinearLayout android:id="@+id/x" > <TextView android:text="Title" ... /> </Linear...

How to create column-like layout for ListView rows?

I have a relative layout which looks like this: Here is the code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/nameText" android:lay...

clickable imageview location change with animation - android

I have an imageview that's included inside a RelativeLayout. When the imageview is clicked, I animate the entire RelativeLayout with a translate animation to move it down. when I click the imageview again (in it's new location) it's supposed to move it back up, but it does not. However, if I click where the imageview started, it does ...

RelativeLayout in dialog has extra space

I am trying to make an AlertDialog that scales in size to the content. The textual content can be larger than the dialog, so it has to be able to scroll. If I use a RelativeLayout everything renders properly no matter how much info there is, but when there is not enough text to fill up the TextView it leaves a lot of extra space. This is...

RelativeLayout height to fill remaining space

I have the following layout in my xml file: <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <FrameLayout android:id="@+id/logoLayout" android:layout_width="fill_parent" android:layout_height="wrap_content"> -- some images </FrameLa...

Add RelativeLayout or ListView inside Gallery View in Android?

Hi, Can someone let me know how to add RelativeLayout or listview inside GalleryView. I have tried by returning listview or RelativeLayout from the adapter of Gallery but it gives ClassCastException java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams. Can someone let me know how to go about it? ...

Multiple Custom View (derived from RelativeLayout) in one line

I have created a custom view by extending Relative Layout and it looks like this: The layout for the view: <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"&gt; <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="ce...

Which layout (AbsoluteLayout etc) is best for simple game programming in the android?

There are the following layout options to create interfaces for android. AbsoluteLayout FrameLayout LinearLayout TableLayout RelativeLayout (and some more) Which of the following is most suitable for designing simple games? Guessing that the absoluteLayout is easiest, but will it be problems with different screen sizes? What do you rec...

How to show empty view when ListView is empty?

Here is my layout. For some reason the empty view (TextView in this case) always appears, even when the List is not empty. I thought the ListView would automatically detect when to show the empty view. How can I hook up the empty view properly? <RelativeLayout android:id="@+id/LinearLayoutAR" android:layout_height="fill_pa...

Why is there extra padding on the bottom of my row?

I have the following layout. This defines a row in my ListView. I noticed that the text is not centered in the row. There seems to be extra bottom padding. How can I make the text appear in the center, vertically, so there is no padding? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk...

My TextView is not appearing right aligned

I want priceText to be right aligned. It is appearing left aligned. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/stocks_gradient"> <TextView andr...

How can I prevent my TextView from overlapping?

How can I prevent this overlapping from occurring without reducing the font size? Here is my XML: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/na...

android forward declarations not working in 1.6

Hello, according to the official site, Android supports forward declarations from version 1.6 onwards. Having adjusted the min SDK and target SDK requirements both to '4' in manifest.xml, the layout editor from eclipse is still complaining about unknown declarations in a relative layout: <xml> <CheckBox android:layout_width="wrap...

Scrolling between views

Hello, I'm currently working on a game for android. I have three ImageView's next to each other, they're positioned next to each other using the "android:layout_toRightOf". The views are located within a RelativeLayout tag. Each of these views are centered into the middle of the screen using "android:scaleType="fitCenter"" and they fil...

Animating a background image.

I have a RelativeLayout with a tiled background. Is there a way to make a tween animation to fade out the existing image and fade in a new one? ...

How to change Nested layout's child viewgroup's width in java code?

Hi All, I have a layout xml file with a linear layout. One of the children is again a ViewGroup Relative layout. In my java code i want to change the width of this child Viewgroup for my requirements. I tried this enter code here ViewGroup childViewGroup = (LinearLayout)findViewById(childViewGroup); LayoutParams l = childViewG...

Relativelayout programatically in android

I'm having trouble finding exactly the syntax I need to use to set the paramters on child views of a relative layout. I have a root relative layout that I want to set 2 child textviews next to each other like this ---------- --------- | Second | | First | ---------- --------- So I have public class RL extends RelativeLayout{ ...

[Android] Nesting Relative layout inside Linear Layout

I have the following code in my layout.xml. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...