android


Circular dependence cannot exist in RelativeLayout


I need to display an ListView between a LinearLayout and a Relative Layout. I want that the height of the ListView to be display according to the screen dimensions. For that, I put layout_height="wrap_content", and I user layout_above and layout_belowm but this returns this :"Circular dependence cannot exist in RelativeLayout".
Here is my layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/firstLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/roadmap_linearlayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:orientation="horizontal" >
........
</LinearLayout>
<ListView
android:id="#+id/listvisit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/roadmap_linearlayout"
android:layout_above="#+id/relativelayout_listpostovisit"
android:layout_marginTop="10dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:cacheColorHint="#android:color/transparent"
android:divider="#drawable/listview_divider"
android:dividerHeight="2dp"
android:scrollbars="vertical" />
<RelativeLayout
android:id="#+id/relativelayout_listpostovisit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/listvisit"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#FFFFFF"
android:orientation="vertical"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true">
.........
</RelativeLayout>
</RelativeLayout>
Any idea how to solve this ?
Thanks in advance.
I want that the height of the ListView to be display according to the screen dimensions.
I am going to translate this as meaning "I want the ListView to fill the available screen space".
For that, I put layout_height="wrap_content"
You cannot reliably use android:layout_height="wrap_content" on a ListView.
and I user layout_above and layout_belowm but this returns this :"Circular dependence cannot exist in RelativeLayout"
That is because your outer RelativeLayout configuration has relativelayout_listpostovisit depend upon the position of listvisit and the position of listvisit depend upon the position of relativelayout_listpostovisit. That cannot work.
Either:
Change relativelayout_listpostovisit, removing android:layout_below="#id/listvisit" and adding android:layout_alignParentBottom="true", or
Switch the outer container to be a LinearLayout rather than a RelativeLayout and switch to using android:layout_weight to allocate extra space to the ListView.

Related Links

how to center an image programatically in a layout described by resource
Action bar tabs fill width
android studio 0.81 cannot resolve symbol #string/hello
Xamarin app deploys on android device but it only runs in the background
SQLite Database lock on large query of INSERTS OR REPLACE
No fill from ad server. in DFP Banner Ads
Why is onConnectionFailed() not called during Android Google+ authentication?
android SurfaceView add callback Asynctask
how can i change call voice on demand in android? (change man to woman and etc) [closed]
Google Cloud Endpoints on Android sometimes gives java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
How do I stop my application from storing sent sms in default android message application?
ExpandableListAdapter with CheckedTextView - complex selection logic
how to add keywords to optimize search for my android application on google play store [closed]
Fetching YouTube video list in Titanium
Android: What happens to Async Task return value
Android app logcat error I cant figure out what this means

Categories

HOME
android
design-patterns
paraview
mjml
sh
composite-primary-key
graphics
error-handling
rendering
javacc
static-site
echo
android-json
okhttp
appcelerator-studio
redis-sentinel
gource
azure-powershell
package.json
dreamweaver
google-content-api
soci
jmp
sar
inno-download-plugin
imageresizer
displaytag
direct3d11
gmock
windows-server-2003
entity-relationship-model
soot
failover
mobx
wacom
activexobject
carriage-return
protege4
password-protection
vmware-fusion
apache-directory
oim
dynamic-linq
tinymce-3
colorbar
sandcastle
testrail
smartfoxserver
mapxtreme
reporting-services-2012
iotivity
file-uri
watch-os-2
signalr.client
embedding
http-status-code-401
concept-insights
ascii-art
toran-proxy
jdi
.bash-profile
amiga
ms-access-2000
fits
bcache
nodelist
formview
human-computer-interface
encryption-asymmetric
with-statement
reflector
mutual-authentication
file-not-found
extjs2
gwt-openlayers
ie8-compatibility-mode
isqlquery
ice-cube
time.h
tree-balancing
fusefabric
usertype
diagrams
eclipse-marketplace
windows-identity
product-management

Resources

Encrypt Message