android - what is root layout in XML? -


<पूर्व> & lt; linearLayout xmlns: android = "http://schemas.android.com/apk/res/android "एंड्रॉइड: आईडी =" @ + आईडी / रूट लेआउट "एंड्रॉइड: layout_width =" fill_parent "एंड्रॉइड: layout_height =" fill_parent "& gt; & LT; scrollview एंड्रॉयड: आईडी = "@ + id / scrollView1" एंड्रॉयड: layout_width = "wrap_content" एंड्रॉयड: layout_height = "80dp" एंड्रॉयड: स्क्रॉलबार = "कोई नहीं" एंड्रॉयड: layout_x = "0dp" एंड्रॉयड: layout_y = "0dp" एंड्रॉयड : FillViewport = "true" & gt; & LT; LinearLayout एंड्रॉयड: आईडी = "@ + id / linearLayout1" एंड्रॉयड: layout_width = "match_parent" एंड्रॉयड: layout_height = "match_parent" & gt; & LT; imageView एंड्रॉयड: आईडी = "@ + id / imageView1" एंड्रॉयड: layout_width = "wrap_content" एंड्रॉयड: layout_height = "wrap_content" एंड्रॉयड: layout_x = "0dp" एंड्रॉयड: layout_y = "0dp" एंड्रॉयड: src = "@ drawable / पृष्ठभूमि "/ & gt; & Lt; / LinearLayout & gt; & Lt; / scrollview & gt; & Lt; / LinearLayout & gt;

यह मेरी एक्सएमएल फाइल है। यह दयालु है, बहुत आसान है। मेरा इरादा है कि स्क्रॉल व्यू की गति को गतिशील रूप से बढ़ाना और छवि (जो स्क्रॉल व्यू के साथ है) दृश्य को धीरे-धीरे दिखाया जाएगा। तो मैं यह कैसे कर सकता हूं और यहां रूटलआउट क्या है और कैसे मैं अपने कोड से रूट लेआउट को कॉल कर सकता हूं ??

<पूर्व> अंतिम टाइमर टाइमर = नया टाइमर (); Timer.scheduleAtFixedRate (नया टाइमर टास्क) (सार्वजनिक शून्य रन) (runOnUiThread (नई रननाबल) (सार्वजनिक शून्य रन () {secondCounter ++; yourNewHyight + = 10; sv.getLayoutParams ()। ऊंचाई = yourNewHyight; LinearLayout रूट = (LinearLayout ) FindViewById (R.id.rootLayout); root.invalidate (); Log.v ("", "" + sv.getLayoutParams ()। ऊँचाई); अगर (द्वितीय सेक्टर == 20) {timer.cancel ();} }})}}}, देरी, अवधि);

ये जावा कोड में मेरा कोड है। लेकिन इसकी कार्यरत नहीं है दोस्तों आप मुझे मदद कर सकते हैं .. !!!

इस लेआउट की जड़ AbsoluteLayout

आप इस रूट का एक संदर्भ देखें को अपने गतिविधि में अपने सभी बच्चों के साथ प्राप्त कर सकते हैं जैसे कॉल का उपयोग:

  mRootView = ((ViewGroup) findViewById (R.id.rootLayout));  

ध्यान दें कि AbsoluteLaoyut लंबे समय से घिस रहा है और आप शायद इसे एक वैकल्पिक ViewGroup , जैसे कि रैखिक लेआउट , रिलेटिव लेआउट , आदि आपके बाकी लेआउट के आधार पर और आप चीजों को कैसे करना चाहते हैं।


Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -