Tag: layout

Is there a way to animate layouts??

Here is what i want to do. Lets say i have a parent linear layout and 3 childs in it. { —————- ++++++++++++++++ ————– } “+”/”-” are the layouts. What i want to do is this: {—— ++++++++++++++++++++++++++++ ——-} //1st step { ++++++++++++++++++++++++++++++++++++ } //2nd step.. Animate the layout “+” taking over the layouts – […]

android custom dialog with scrollview pushes buttons off the screen

I have a custom dialog with a layout like this: <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:id=”@+id/mylayout”> <LinearLayout android:id=”@+id/title” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”vertical”> <TextView … /> <TextView …/> </LinearLayout> <ScrollView android:id=”@+id/scrollView” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_below=”@+id/title”> <LinearLayout …> <TextView … android:text=”lots of text……..” /> <TextView …/> </LinearLayout> </ScrollView <RelativeLayout … android:layout_below=”@+id/scrollView”> <Button …> <Button …> </RelativeLayout> </RelativeLayout> My problem […]

Z order in xml android

can someone give me a good explanation regarding Z order. Firstly, I don’t understand what it is and(something like the definition)and secondly how an element of a Z order looks like. I hope I am explicit enough.

LinearLayout analog inside Table in LibGDX

I want to create a game menu screen in LibGDX using scene2d package with following layout | label | | btn btn btn | | label | My code looks as follows: Table table = getTable(); table.add(label1); table.row(); table.add(button1); table.add(button2); table.add(button3); table.row(); table.add(label2); table.row(); But instead of what I want I get something like this: […]

Android background string resource

I am working on a layout XML file, and I want to set a background color for a LinearLayout. This bit, which I am now using, works perfectly: android:background=”#1a64b7″ However, I would much prefer to break that out. In my strings.xml file I have <string name=”bg_blue”>#1a64b7</string> but when I use that in the following manner: […]

ImageView adjustViewBounds not working with Relative Layout

I have an ImageView and have set its layout_height to “100dp” and its layout_width to “wrap_content”. The drawable used has bigger actual dimensions that are 130dp (width) X 215dp (height). When the ImageView is placed inside a LinearLayout, if I set adjustViewBounds to true, it gets a width that is measured according to the drawable’s […]

How to use own view in layout?

I created a class like this public final class MyView extends View { public MyView(Context context, AttributeSet attrs) { super(context, attrs); […] } […] } and then I want to use it within my layout.xml <?xml version=”1.0″ encoding=”utf-8″?> <FrameLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent”> <com.hitziger.barcode.MyView android:id=”@+id/my_view” android:layout_width=”fill_parent” android:layout_height=”fill_parent”/> </FrameLayout> But Eclipse tells me in the error log […]

What's the difference between StaticLayout and DynamicLayout

I understand that DynamicLayout is intended for a Layout that has its text being changed, whereas StaticLayout deals with an immutable text. However, the two classes mostly have the same methods, according to their docs: http://developer.android.com/reference/android/text/StaticLayout.html http://developer.android.com/reference/android/text/DynamicLayout.html Specifically, I don’t see a method setText() on the DynamicLayout class. What is their difference, and how can […]

Resources$NotFoundException in Graphical Layout ADT preview (but app actually Works)

My problem is that loading an array of strings defined in XML works in the app but will result in an error in the ADT Graphical Layout preview. Now I can’t see any graphics in the Graphical Layout because of this error, and it’s difficult to work with other graphics. But the view is loading […]

How to wrap Image buttons in a horizontal linear layout?

Is there any way to wrap Image buttons in Horizontal Linear Layout? Or is there any other way to do the following thing? I have six image buttons. Suppose these buttons are appearing in a mid resolution device like this : Image button 1 | Image button 2 | Image button 3 | (1st row) […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.