Tag: layout

Get Child view in a RelativeLayout

I want to add one button in my activity that will return all child view of relative layout. How can i get all child view of relative layout view?

Android – Two buttons in same line filling the whole width

I have a little problem defining a Relative Layout. I have a List View with scroll and two buttons always visible at the bottom of the list view. I just would like my two button have 50% of the width, filling the line. This is my 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” android:orientation=”vertical” […]

Only relayout children and not all the tree

I’m trying to recreate ListView (and AbsListView) logic, with view recycling. I need this but we can say it’s only for understand Android logic. Suppose my children items are the same (same layout), using fixed height RelativeLayout. During scrolling, I’m reusing ghost children view and set properties for current item. It’s working fine, since I’m […]

How to set android show vertical orientation?

From following .xml file I set xml to show TabHost but after i run it on emulator it show both both orientation. i want to set it to show only one orientation. How do i do? THanks you. <TabHost xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@android:id/tabhost” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical”> <RelativeLayout android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical”> <FrameLayout android:id=”@android:id/tabcontent” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:layout_alignParentTop=”true” android:layout_above=”@android:id/tabs” /> […]

Android TextView text won't center

I am trying to make a PIN entry activity, but one little thing is not quite working for me. I can’t get the text to center in the TextView’s at the top of the screenshot here: The way it will work is when the user is entering a PIN, I will place a star in […]

How to change layout preview default devices on Android Studio

When I create a new layout, the default device is Nexus 4. How can I change default device that when next time I create a new layout, the device will be Nexus 5, but NOT nexus 4.

Rotate android layout view about its center using touch listener

Here is how my set up to rotate looks. I am listening for action down and move on the rotation icon, trying to calculate the angle of rotation and applying that angle of rotation to entire layout encapsulating the edittext. The applied rotation has to be about the center of encapsulating relative layout. Here is […]

How can I set the height of GridView cell based on screen height?

In my layout I have only eight cells. I want the cell divide all the space available on the screen. Is this possible? This is my gridview layout: <GridView xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/dataGrid” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:padding=”10px” android:verticalSpacing=”10px” android:horizontalSpacing=”10px” android:numColumns=”2″ android:gravity=”fill” /> And this is the item layout: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:padding=”6dip” > <TableRow […]

Android Studio doesnt render WebP format

I am trying to use webp format pictures in my drawable folder. But unfortunately android studio cant render the file and it is not shown on the layout. Is there any solution for this?

Android 3.2 same layout for all screens

i set following layout configuration for my app small,normal,large,xlarge screen layouts are fine for android 1.5 to 3.1. In android 3.2 all screens i.e small (320 x 426 with density 160), normal (320 x 470 with density 160), large (480 x 640 with density 160) , xlarge (720 x 960 with density 240) only takes […]

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