10

एंड्रॉइड 6.0 पर मार्शमलो विशेषताएँ बेसलाइन और लेआउट_लाइन साइनलाइन के साथ एक रिलेवेटिवआउट में एक छवि दृश्य के संबंध में एक संपादन टेक्स्ट की स्थिति को और काम नहीं करता है। एंड्रॉइड स्टूडियो में लेआउट एडिटर में व्यवहार भी देखा जा सकता है। एक वास्तविक एंड्रॉइड मार्शमलो डिवाइस पर या मेरे मामले में एडिटटेक्स्ट को अनुकरण करने के लिए स्क्रीन के बाहर स्थानांतरित होता है और दिखाई नहीं देता है। क्या मुझे कुछ बदलाव याद आते हैं, क्या यह एक बग है?मार्शमलो रिलेवेटिवआउट अलाइन के साथ अजीब व्यवहार करता है बेसलाइन

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
android:paddingBottom="@dimen/activity_vertical_margin" 
tools:context=".MainActivityFragment"> 

<ImageView 
    android:layout_width="48dp" 
    android:layout_height="48dp" 
    android:id="@+id/imageView" 
    android:src="@drawable/icon_category_geography_raster" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:baselineAlignBottom="true" 
    android:background="#00ffff" 
    /> 

<EditText 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/editText" 
    android:layout_alignParentTop="true" 
    android:layout_toRightOf="@id/imageView" 
    android:background="#ff0000" 
    android:inputType="text" 
    android:hint="Hint" 
    android:layout_alignBaseline="@id/imageView" /> 

मैं एंड्रॉयड स्टूडियो के लेआउट संपादक के स्क्रीनशॉट बनाया है। इन दो स्क्रीनशॉट के बीच का अंतर पूरी तरह से एपीआई स्तर का परिवर्तन है।

मैं एक नमूना परियोजना https://github.com/mikegr/baseline

Layout Editor with API Level 22 Layout Editor with API Level 23

+0

यह निश्चित रूप से एक बग की तरह लगता है। मैं आपके नमूने ऐप से अपने निष्कर्षों को पुन: उत्पन्न कर सकता हूं। आपके 'एडिटटेक्स्ट' (या 'AppCompatEditText' के रूप में यह चालू हो जाता है) पदानुक्रम दृश्य (mBottom = -193, mTop = -230 WVGA800-आकार वाली एमुलेटर स्क्रीन पर) के अनुसार ऋणात्मक लंबवत स्थिति रखने के लिए हवाएं)। – CommonsWare

+0

क्या किसी ने इसे Google को बताया है? – Zharf

+0

कार्लटन व्हाइटहेड ने यहां बग की सूचना दी है: https://code.google.com/p/android/issues/detail?id=190839 –

उत्तर

0

इस बग https://code.google.com/p/android/issues/detail?id=73697&thanks=73697

पर बताया जाता है API11 के बाद से आप बस API11 नीचे android:baselineAlignBottom="true"

उपयोग कर सकते हैं आप getBaseLine() अधिलेखित कर सकते हैं बनाया है ।

Android Support Library 23.2.1 पर अपडेट करें, यह आपकी समस्या का समाधान कर सकता है।

संबंधित मुद्दे