tablelayout


Tablelayout and LinearLayout - visible and invisble


I want to have a table layout inside a linear layout so that there is text before and after the table layout. The issue is that I want to be able to switch between 2 tables (Table1 and Table2) but keep the text before and after the same. I thought that this would be manageable using visible and invisible features of tablelayout and define the whole thing in one layout but this doesnt seem to be the case. What I get is that when I make Table2 visible and Table1 invisble that Table2 is shifted down because I have defined it after Table 1 in the layout.
What I want is:-
SomeTextHere
Table1
SomeTextHere too
or
SomeTextHere
Table2
SomeTextHere too
What I get is:-
SomeTextHere
Table1
SomeTextHere too
SomeTextHere
Table2
SomeTextHere too
I have tried:-
LinearLayout
TableLayout1 make visible
TableLayout2 make invisible
LinearLayout
Any ideas?
If i got your question correctly i think what you can do is adding two more LinearLayout in your main LinearLayout.Then put the group (Text,Table,Text) in each LinearLayout and then you can work with each Linear Layout instead of working with text,table,text
So that your layout hierarchy looks like
< LinearLayout>
< LinearLayout>
< Text>
< TableLayout>
< Text>
< /LinearLayout>
< LinearLayout>
< Text>
< TableLayout>
< Text
< /LinearLayout>
< /LinearLayout>
Your problem is you're using View.INVISIBLE to hide the sections. You need to use View.GONE if you want a view to not take up space in a layout.
Also if only the table is changed then you don't need to duplicate just put the tables one after the other and set the visibility of the one that shouldn't be visible by default set to gone. Then you can just toggle them in code.

Related Links

AutoLink Doesnot work on Table Layout lolipop
Getting value from dynamic table in Android
set background image in table layout
How to dynamically draw a TableLayout from AsyncTask
Tablelayout and LinearLayout - visible and invisble

Categories

HOME
pdf
bluetooth
isabelle
routes
jira
sharepoint-designer
frameworks
dxl
callback
disassembler
yum
pivotal-cloud-foundry
django-imagekit
pheatmap
reveal.js
numeral.js
rascal
dtrace
serilog
database-replication
contextmenu
textfield
swiftlint
zapier
jquery-ajaxq
web-sql
tibco-mdm
cultureinfo
qhull
rst2pdf
windows-error-reporting
social-media
ping
directx-10
http-status-code-503
perlin-noise
overriding
host
plsql-psp
appfabric
hockeyapp
sharefile
user-controls
tasker
squib
sfdc
sql-server-agent
dynamic-reports
elmah
total-commander
babel-core
youcompleteme
atomicity
drupal-6
darcs
slickedit
kbuild
zendesk-app
gcsfuse
color-profile
mediaelement
jquery-filter
log4c
multi-level
transmitfile
google-web-starter-kit
nsviewcontroller
blackberry-10
cloudbees
energy
vhd
qtableview
coveralls
interrupted-exception
appfabric-cache
skos
umbraco6
ng-animate
winddk
sgen
prettify
uv-mapping
pyhdf
google-cloud-save
listings
jplaton
qt-faststart
seed
ember-app-kit
eventlistener
drools-planner
factory-method
jquery-knob
javaspaces
work-stealing
javax.script
calling-convention
xfbml
datareader
google-friend-connect
genealogy

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile