Tag: layout

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 […]

Implementing a multicolumn ListView with independant Row-heights

I would like to create a list of about 200 ImageViews (random heights) with the following layout in a ‘collage’ fashion: Normally I would do this in a ListView for the peformance gained by using Adapters but since i want the images to be displayed in columns, and with different height (See picture Example ) […]

Layout like radial menu

I have to design something like this and add click event for each block,how should I proceed for that.Could anyone guide me regarding this

Android: Alignment of four squares

I am trying to align four equally sized squares on an Android Screen & I have now tried what feels like a million different approaches, yet none of them seem to work :(. What I’ve got at the moment is the following: <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/MasterLayout” android:layout_width=”wrap_content” android:layout_height=”fill_parent” android:background=”#FFFFFF”> <TableLayout android:layout_width=”fill_parent” android:id=”@+id/mainlay” android:background=”#444444″ android:layout_weight=”0.2″ android:layout_height=”wrap_content” android:padding=”0dip”> […]

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