मैं एंड्रॉइड 3.1 विकसित कर रहा हूं। और आवेदन के ऊपर।यह सापेक्ष लयआउट लेआउट या इसके लीनियरलाउट पेरेंट बेकार है
एक गतिविधि पर मैं गतिशील रूप से अपना लेआउट उत्पन्न करता हूं। मैं formdetail.xml उपयोग कर रहा हूँ contentView के रूप में:
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.formdetail);
Bundle extras = getIntent().getExtras();
if (extras != null)
{
currentFormId = extras.getString("FormId");
}
}
formdetail.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/detailLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/downloadFormsButton"
android:enabled="false"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="@string/download_forms_button" />
<TextView
android:id="@+id/formErrorMsg"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="16dp" >
</TextView>
</RelativeLayout>
</LinearLayout>
downloadFormsButton
और formErrorMsg
रूप में हमेशा होना चाहिए।
लेकिन उस xml का उपयोग कर मैं इस चेतावनी मिलती है:
This RelativeLayout layout or its LinearLayout parent is useless
मैं LinearLayout जरूरत TableLayouts प्रोग्राम के रूप में जोड़ने के लिए।
मैं इस चेतावनी को कैसे हल कर सकता हूं?
मुझे लगता है कि आपके माता-पिता लेआउट रैप केवल एक ही बच्चा है और आप – Borys