Alert Dialog transparent

  • Antworten:0
NewAndroidGuy
  • Forum-Beiträge: 62

31.10.2012, 18:58:34 via Website

hey ich würde gern dass über einem Grid,wenn man es berührt,3 buttons erscheinen.
ich habe dazu einen Alertdialog benutzt.
wenn es ne andere möglichkeit gibt wäre das toll denn ich verzweifle gerade.
alles was im e-net stand funzt nicht richtig

XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:orientation="vertical"
android:background="@drawable/transparent"> -> zeigt auf drawable <color:"#0000000"/>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical" >


<Button
android:id="@+id/habut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/roundcorners"
android:minHeight="50dp"
android:minWidth="150dp" />

</LinearLayout>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp" >

<EditText
android:id="@+id/hafield"
android:layout_width="match_parent"
android:layout_height="200dp"
android:maxLines="10"
android:ems="10"
android:inputType="textMultiLine" >

<requestFocus />
</EditText>

</LinearLayout>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >

<TextView
android:id="@+id/tillfield"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="right"/>

</LinearLayout>

</LinearLayout>

main:

AlertDialog.Builder alert = new AlertDialog.Builder(
GridstundenplanActivity.this);


LayoutInflater inflater = (LayoutInflater)this.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
View xml = inflater.inflate(R.layout.homeview,null);

Antworten