Inherent Text Bottom Padding

Discussion in 'Android Hacks and Help' started by APassivePoke, Jan 11, 2010.

  1. APassivePoke

    APassivePoke New Member

    Joined:
    Dec 21, 2009
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I'm just getting started on Android development and am making a simple digital clock widget to get started with practice. I'm having trouble with my text alignment.

    I have a RelativeLayout with a TextView, ImageView, and then another TextView. The ImageView is a 1px high divider. I want both of the TextViews to be right against the divider, with only 1px of space, but no matter how many margins and paddings i set to 0 there is still a largish (10px or so) gap between the text and the divider.

    This is what it looks like:

    [​IMG]

    And this is what I want it to look like (thanks to photoshop):

    [​IMG]

    Here's my layout file.

    HTML:
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="top"
        android:background="#99000000"
        >
    <TextView  
    	android:id="@+id/widget_timeView"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:textColor="@android:color/white"
        android:typeface="sans"
        android:textSize="50sp"
        android:layout_marginLeft="5dip"
        android:layout_marginBottom="0px"
        android:paddingBottom="0px"
        />
    <ImageView   
    	android:id="@+id/widget_divider"
      	android:layout_width="fill_parent"
      	android:layout_height="wrap_content"
      	android:src="@drawable/divider" 
      	android:layout_below="@id/widget_timeView"
      	android:layout_marginTop="0px"
      	android:layout_marginBottom="0px"
      	android:paddingTop="0px"
      	android:paddingBottom="0px"
      	/>
    <TextView  
    	android:id="@+id/widget_dateView"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:textColor="@android:color/white"
        android:typeface="sans"
        android:textSize="16sp"
        android:layout_below="@id/widget_divider"
        android:layout_marginRight="20dip"
       	android:layout_marginTop="0px"
       	android:paddingTop="0px"
       	android:layout_alignParentRight="true"
        />
    </RelativeLayout>
    
    Any suggestions on how I can eliminate that space?
     
Search tags for this page

android paddings text

,

android textview padding bottom

,

text padding textview android