Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
header cover by the scrollview
shawn peter
Ranch Hand
Posts: 1325
1
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have a header in my xml file.Also i have scrollview in that xml file.the issue is header is not shown.i am adding the data to the table programatically.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/headerView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" > <ViewStub android:id="@+id/vsHeader" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inflatedId="@+id/header" android:layout="@layout/header" /> </LinearLayout> <ScrollView android:id="@+id/tableview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/headerView" > <HorizontalScrollView android:layout_width="match_parent" android:layout_height="match_parent" > <TableLayout android:id="@+id/maintable" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="0,1" > </TableLayout> </HorizontalScrollView> </ScrollView> </RelativeLayout>
below is the part of
java
file which adds data to table
tl = (TableLayout) findViewById(R.id.maintable); for (int i = 0; i <x]; i++) { TableRow productionmorning = new TableRow(this); productionmorning.setId(i+1); productionmorning.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); // Create a TextView for each day in week if(morning_monday_Production.size()>i){ TextView prodttext = new TextView(this); //prodttext.setBackgroundColor(Color.parseColor("#bdbdbd")); prodttext.setId(i+1); prodttext.setText(morning_monday_Production.get(i)); prodttext.setTextColor(Color.BLACK); prodttext.setBackgroundDrawable(getResources().getDrawable(R.drawable.border4)); prodttext.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); productionmorning.addView(prodttext); TableRow.LayoutParams params = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.height = 60; params.width = 100; params.setMargins(0, 0, 0, 0); prodttext.setLayoutParams(params); }else{ TextView prodttext = new TextView(this); prodttext.setId(i+1); prodttext.setText(" "); prodttext.setTextColor(Color.BLACK); prodttext.setBackgroundDrawable(getResources().getDrawable(R.drawable.border4)); prodttext.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); productionmorning.addView(prodttext); TableRow.LayoutParams params = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.height = 60; params.width = 100; params.setMargins(0, 0, 0, 0); prodttext.setLayoutParams(params); }
shawn peter
Ranch Hand
Posts: 1325
1
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
can anyone please help me?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Layout question.
last button(Sybmit) not shown when testing via phone
how to add two buttons below
how to add textviews dinamically
How to get the value of textview inside tablerow in android
More...