एंड्रॉइड स्टूडियो (वी 2.3.1) के साथ match_parent को प्रतिस्थापित करता रहता है, एक निश्चित डीपी वैन्यू के साथ रिलेटिव लेआउट के match_parent
को प्रतिस्थापित करता रहता है। उदाहरण के लिए, जब मैं चौड़ाई के रूप में match_parent टाइप करता हूं, तो यह इसे 368 डीपी के साथ बदल देता है। जब मैं ऐप का परीक्षण करता हूं, तो मुझे लगता है कि सापेक्ष लयआउट वास्तव में गलत है।एंड्रॉइड स्टूडियो निश्चित डीपी वैल्यू
क्या कोई यह जानता है कि इसे कैसे ठीक किया जाए?
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="be.mawey.lamachat.LoginActivity">
<RelativeLayout
android:layout_width="match_parent" <!-- THIS IS BEING REPLACED WITH 368dp -->
android:layout_height="match_parent" <!-- THIS IS BEING REPLACED WITH 495dp -->
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">
<Button
android:id="@+id/buttonLogin"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:background="@color/colorPrimary"
android:text="Login"
android:textColor="@android:color/white"
android:textSize="18sp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="292dp" />
<EditText
android:id="@+id/editTextCode"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_above="@+id/buttonLogin"
android:layout_alignParentStart="true"
android:ems="10"
android:hint="Secret code here"
android:inputType="numberPassword"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="234dp" />
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="50dp"
android:fontFamily="monospace"
android:text="example"
android:textAlignment="center"
android:textColor="@color/colorPrimaryDark"
android:textSize="36sp"
android:textStyle="italic"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="16dp" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
बनाए रखने के लिए बनाए रखें match_parent निश्चित डीपी का उपयोग न करें। –
आपका क्या मतलब है? मैं एक निश्चित डीपी का उपयोग नहीं करता, एंड्रॉइड स्टूडियो सिर्फ मुझे match_parent –
का उपयोग नहीं करने देता है, क्या आप अपनी पूर्ण xml फ़ाइल –