tablelayout


set background image in table layout


i have used table layout for my one xml
i am trying to add one background image as follows:
android:background="#drawable/myimg"
den i am getting error like
02-28 11:58:57.713: E/AndroidRuntime(850): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/com.test.Scan}: android.view.InflateException: Binary XML file line #3: Error inflating class android.widget.TableLayout
i have even tried like following:
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/bkg1">
<TableLayout
android:id="#+id/linearLayout1_tblLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/linearLayout1_tblLayout1_tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" >
......
</TableRow>
</TableLayout>
</LinearLayout>
then also i am getting same error.
please some one helppp me.!
Thank you.
sorry guyz , it was my mistake
i was using jpeg format's file.
when i used .png file.
i managed to solve my problem..
YOU CAN SET ONLY .PNG FORMAT'S FILE TO LAYOUT

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
ionic-framework
multithreading
c#-4.0
google-docs
adb
getelementsbytagname
react-redux
webpack-2
baqend
acquia
networkx
mouse
in-app-purchase
multiple-records
synchronization
slurm
gitpitch
metatrader4
adobe-analytics
reveal.js
izpack
quicklook
commonmark
designer
after-effects
tostring
finite-automata
excel-vba-mac
conemu
cx-freeze
riot.js
dcevm
smb
virtualdub
ping
unboundid
media-queries
google-cloud-endpoints-v2
create-table
subset-sum
atl
dartium
web-mining
hockeyapp
libraries
flashair
darcs
diagnostics
kbuild
messenger
firmata
static-ip-address
angular-cache
heidisql
android-textview
dstu2-fhir
mathematica-frontend
connect-by
essence
qgraphicsview
pagerank
tform
browser-link
python-3.2
dukescript
p2
asp.net-dynamic-data
internet-connection
starcluster
navigationservice
undefined-reference
rtmfp
ember-charts
imdbpy
oam
odata4j
dataadapter
e4x
browser-detection
dmoz
newtonscript
objective-c-2.0
transactionscope
data-loss
oncheckedchanged
iphone-web-app
infrastructure
sproutcore-2
suppress
routedevent
user-friendly
data-driven
mtj
privilege
putchar
w3wp
commodore
rtml

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile