मैं इस सरल संवाद अर्द्ध पारदर्शी बनाने के लिए कोशिश कर रहा हूँ बनाने के लिए:कैसे इस सरल संवाद टुकड़ा अर्द्ध पारदर्शी
class TestDialog extends SherlockDialogFragment
{
public TestDialog()
{
super();
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceStateBundle)
{
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
// Get the layout inflater
LayoutInflater inflater1 = getActivity().getLayoutInflater();
// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the dialog layout
builder1.setView(inflater1.inflate(R.layout.dlg_test, null))
// Add action buttons
.setPositiveButton("Ok", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int id)
{
// sign in the user ...
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int id)
{
}
});
return builder1.create();
}
}
लेआउट पीछा कर रहा है:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:hint="User name" />
</LinearLayout>
मैं सब कुछ कोशिश की है, रेखीय लेआउट की पृष्ठभूमि drawable के रूप में एक पारदर्शी .png का उपयोग करने से, 0.5 करने के लिए अल्फा क्षेत्र की स्थापना एक drawable के रूप में एक रंग 0. के बराबर का उपयोग करने के लिए मुझे लगता है कि संवाद अर्द्ध पारदर्शी बनाने के लिए सक्षम नहीं हूँ। मैं नहीं जानता कि भले ही यह संभव है। क्या मैं बनाना चाहेंगे निम्न छवि में पैनल की तरह एक संवाद है: । धन्यवाद। Note1: न्यूनतम एसडीके आवश्यक संस्करण 8 है, लक्ष्य नवीनतम (वास्तव में, v17) है।
मुझे लगता है कि इस पर निर्भर हो सकता है: एक संबंधित सवाल का
मेरा उत्तर के लिए लिंक एसडीके संस्करण। 1.6 संवाद में डिफ़ॉल्ट रूप से अर्ध-पारदर्शी होते हैं लेकिन 'AlertDialog.builder (संदर्भ संदर्भ, int विषय)' का प्रयास करें, जहां थीम 'android.R.style.Theme_Dialog है। – techiServices
क्या आपने XML में 'android: background =" # 4000 "' जैसे कुछ का उपयोग करने का प्रयास किया है? (# 4000 ARGB_4444 रंगस्थान है)। – techiServices
मैंने दोनों की कोशिश की है लेकिन यह काम नहीं किया है। –