Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - [Solved] setLayoutParams() hides View

[Solved] setLayoutParams() hides View

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

[Solved] setLayoutParams() hides View

Postby konic » Fri Oct 09, 2009 1:40 pm

Hi,
here is piece of code in onCreate() of TabActivity:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. TabWidget tw = getTabWidget();
  2. // take second tab
  3. RelativeLayout rl = (RelativeLayout)tw.getChildTabViewAt(1);
  4. TextView tv = (TextView)rl.getChildAt(1);
  5. ViewGroup.LayoutParams vp = rl.getLayoutParams();
  6. RelativeLayout.LayoutParams rp = new RelativeLayout.LayoutParams(vp);
  7. // these rules are the same as default ones
  8. rp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
  9. rp.addRule(RelativeLayout.CENTER_HORIZONTAL);
  10. // after setting these params TextView disappears from screen.
  11. // it is still in hierarchy (used hierarchyviewer to check it) 'though
  12. tv.setLayoutParams(rp);
  13.  
Parsed in 0.013 seconds, using GeSHi 1.0.8.4

Could somebody explain what is wrong here?
...
P.S. One more strange thing, - Hierarchy Viewer shows that width of this View is 0
although there is some text (Tab 2) !?
Even if I explicitly set width to, say, 100pix, it still shows as 0 in Viewer :(
Last edited by konic on Fri Oct 09, 2009 4:55 pm, edited 1 time in total.
konic
Developer
Developer
 
Posts: 32
Joined: Mon Aug 24, 2009 3:16 pm

Top

Postby konic » Fri Oct 09, 2009 4:52 pm

OK,
problem is solved, although
I still don't know what was so wrong in the first place !?
I just replaced
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. ViewGroup.LayoutParams vp = rl.getLayoutParams();
  3.  
  4. RelativeLayout.LayoutParams rp = new RelativeLayout.LayoutParams(vp);
  5.  
  6.  
Parsed in 0.010 seconds, using GeSHi 1.0.8.4

with
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. RelativeLayout.LayoutParams rp = new RelativeLayout.LayoutParams(
  3.  
  4.                                                     LayoutParams.FILL_PARENT,
  5.  
  6.                                                     LayoutParams.FILL_PARENT);
  7.  
  8.  
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
konic
Developer
Developer
 
Posts: 32
Joined: Mon Aug 24, 2009 3:16 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests