score:1
you can use match_parent
in the table layout so it takes the full width of the parent then adjust left and right padding to generate the desired separation. bear in mind that you already have a padding defined in your relative layout hence you you will need to play with both values.
<tablelayout
android:id="@+id/tablelayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingleft="10dp"
android:paddingright="10dp"
android:layout_alignparentbottom="true"
android:layout_centerhorizontal="true" >
score:0
you set android:layout_width="wrap_content"
to the tablelayout
which causes it to be just wide enough to show all the content. try using match_parent
to make it take the entire parent width:
<tablelayout
android:id="@+id/tablelayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignparentbottom="true"
android:layout_centerhorizontal="true" >
another thing that shrinks your tablelayout
down is this:
android:paddingbottom="@dimen/activity_vertical_margin"
android:paddingleft="@dimen/activity_horizontal_margin"
android:paddingright="@dimen/activity_horizontal_margin"
android:paddingtop="@dimen/activity_vertical_margin"
in the parent relativelayout
. if the first step does not suit your needs, you can try setting lower paddingleft
and paddingright
values.
score:0
try this edit
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.funkycalc.mainactivtiy\" >
<tablelayout
android:id="@+id/tablelayout1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignparentbottom="true"
android:layout_centerhorizontal="true" >
the padding values was the problem...
Source: stackoverflow.com
Related Query
- Android Eclipse - Increasing side margins on my table layout
- Eclipse IDE - Android Graphical Layout and XML Layout Side by Side
- How to get the graphical layout Window back in Eclipse for Android Application Design?
- Eclipse Android Graphical Layout Editor Broken
- better Android XML Layout Editor than the one in Eclipse
- Error while opening the Eclipse Android Layout Editor
- Can not launch android project from xml layout file in Eclipse
- Android development - 'missing theme error' in eclipse ide for layout xml files
- Eclipse Android layout designer - add new screen sizes for previewing
- Eclipse Not Showing Graphical Layout for Android XML files
- Inside Eclipse Android project run Java classes with main(String[] args) as Java Application causes "Invalid layout of java.lang.String at value"
- Eclipse is missing Graphical Layout and Source tabs when editing Android XML files
- Can you add subfolder to layout in Eclipse Android project?
- Graphical Layout Scroll Problem in Eclipse Android Development
- Eclipse Content Assist Not Working Properly For Android Layout
- Editing multiple elements in Android XML layout via Eclipse
- Landscape preview of android xml layout in Eclipse
- Eclipse ClassCastException when trying to expand XML layout for Android
- Android Eclipse Linear Layout with multiple text views not wrapping
- Shortcut to open Android XML layout in Eclipse
- How to disable titlebar in eclipse android plugin Graphical layout preview?
- Android eclipse Dump SQLite table row into text file
- Eclipse is showing all the android layout items as they had gravity "right"
- Search for the references to a layout xml file in android code using eclipse IDE for android
- Android Eclipse Layout doesn't seen on SDK 8
- Unable to drag UI elements to Android layout Eclipse
- Eclipse - Show layout guides (lines) in the graphical layout for Android views
- Eclipse Android XML Layout Header and Footer
- Eclipse Android Layout NullPointerException
- How to program a button to export table layout to image or PDF file on android app
More Query from same tag
- Eclipse won't save new files in the original project folder
- Unable to launch Eclipse RCP application product - The Launcher was unable to locate its companion shared library
- Why is Setting Up a Development Environment for Android 2.3 under Windows so Nightmarish?
- Missing class in Maven project using Exchange web services
- Eclipse Code Format Behavior
- Issue with Java Eclipse Project after exporting
- how draw in realtime to tableLayout - in android with eclipse
- java Scanner declaring
- KeyListener doesn't work at all but my code worked fine on my friend's computer
- Ubuntu 12.10 : Eclipse closes automatically
- Change activity in android program automatically at a given time
- Tools jar does not exist Eclipse JAVA
- AVD Targeting Multiple Platforms
- Eclipse configuration to run a JNI project
- Java JDK versions eclipse Blackboard 9.1 java.lang.UnsupportedClassVersionError
- Error compiling project with GWT
- Why Che server is unable to ping your workspace?
- disable checkbox in a simple list view multi choice?
- android-seach option in actionBar without creating custom theme
- Assign numbers from a txt file to a String variable in java?
- Worklight 6.2 cannot find runtime when opening Worklight Console
- Can Eclipse CDT do auto-complete when using typedefs?
- Running a program in eclipse
- Error or not error? What does this unreadable line in Maven install output mean?
- Eclipse loses my "Show line numbers" preference setting
- Eclipse/MapReduce plugin
- swt library - link to eclipse javadoc
- Unexpected Error in Eclipse
- How do I configure the ADT plugin in the eclipse
- How to add classes folder in web-inf in eclipse