简体   繁体   中英

QuickcontactBadge not showing up in Layout when ran the app

I am using a FrameLayout with some EditText controls and a QuickContactBadge. Its fine till here. when I run the app, I am able to see all the controls, but QuickContactBadge not appearing in the layout.

What I need to do to make it visible? Did I miss anything?

This is my layout file,

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<ImageView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scaleType="fitXY"
    android:src="@drawable/pattern1" />

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="50dp"
    android:orientation="vertical" >

    <ScrollView
        android:layout_width="wrap_content"
        android:layout_height="fill_parent" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >

                <QuickContactBadge
                    android:id="@+id/quickContactBadge1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentRight="true"
                    android:layout_alignParentTop="true"
                    android:layout_marginRight="10dp"
                    android:scaleType="centerCrop" />

                <EditText
                    android:id="@+id/txtlastname"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentLeft="true"
                    android:layout_alignRight="@+id/edttxtfirstname"
                    android:layout_marginTop="50dp"
                    android:ems="10"
                    android:hint="Last Name"
                    android:inputType="textPersonName"
                    android:textColor="#000000" />

                <EditText
                    android:id="@+id/edttxtfirstname"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentTop="true"
                    android:ems="10"
                    android:hint="First Name"
                    android:inputType="textPersonName"
                    android:textColor="#000000" >

                    <requestFocus />
                </EditText>
            </RelativeLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="#000000" >
            </View>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >

                <TextView
                    android:id="@+id/txtheadingphone"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_alignParentBottom="true"
                    android:layout_alignRight="@+id/editText2"
                    android:layout_gravity="center"
                    android:layout_marginRight="70dp"
                    android:layout_weight="0.63"
                    android:gravity="center_vertical"
                    android:text="Phone"
                    android:textColor="#ffffffff" />

                <ImageButton
                    android:id="@+id/imgbtnaddphone"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@android:drawable/ic_input_add" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >

                <Button
                    android:id="@+id/btnchphone"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Phone"
                    android:textColor="#ffffffff" />

                <EditText
                    android:id="@+id/edttxtphone"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.48"
                    android:ems="10"
                    android:gravity="center"
                    android:hint="Phone Number"
                    android:inputType="phone"
                    android:textColor="#000000" />

                <ImageButton
                    android:id="@+id/imgbtndelphone"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@android:drawable/ic_input_delete" />
            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="#000000" >
            </View>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >

                <TextView
                    android:id="@+id/txtheadingaddress"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_alignParentBottom="true"
                    android:layout_alignRight="@+id/editText2"
                    android:layout_gravity="center"
                    android:layout_marginRight="70dp"
                    android:layout_weight="0.63"
                    android:gravity="center_vertical"
                    android:text="Address"
                    android:textColor="#ffffffff" />

                <ImageButton
                    android:id="@+id/imgbtnaddAddress"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@android:drawable/ic_input_add" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" >
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >

                <Button
                    android:id="@+id/btnAddress"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Home"
                    android:textColor="#ffffffff" />

                <EditText
                    android:id="@+id/edttxtaddress"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:gravity="center"
                    android:hint="Address"
                    android:inputType="textPostalAddress"
                    android:textColor="#000000" />

                <ImageButton
                    android:id="@+id/imgbtndeladdress"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@android:drawable/ic_input_delete" />
            </LinearLayout>

            <EditText
                android:id="@+id/edttxtcity"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ems="10"
                android:gravity="center"
                android:hint="City"
                android:textColor="#000000" />

            <EditText
                android:id="@+id/edttxtstate"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ems="10"
                android:gravity="center"
                android:hint="State"
                android:textColor="#000000" />

            <EditText
                android:id="@+id/edttxzipcode"
                android:layout_width="236dp"
                android:layout_height="wrap_content"
                android:ems="10"
                android:gravity="center"
                android:hint="ZipCode"
                android:inputType="phone"
                android:textColor="#000000" />

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="#000000" >
            </View>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >

                <TextView
                    android:id="@+id/txtemail"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:layout_marginRight="70dp"
                    android:layout_weight="0.63"
                    android:gravity="center_vertical"
                    android:text="Email"
                    android:textColor="#ffffffff" />

                <ImageButton
                    android:id="@+id/imgbtnaddemail"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@android:drawable/ic_input_add" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >

                <Button
                    android:id="@+id/btnchemail"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Email"
                    android:textColor="#ffffffff" />

                <EditText
                    android:id="@+id/edttxtemail"
                    android:layout_width="128dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.48"
                    android:ems="10"
                    android:gravity="center"
                    android:hint=""
                    android:inputType="textEmailAddress"
                    android:textColor="#000000" />

                <ImageButton
                    android:id="@+id/imgbtndelemail"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@android:drawable/ic_input_delete" />
            </LinearLayout>
        </LinearLayout>
    </ScrollView>
</LinearLayout>

<LinearLayout
    android:id="@+id/LinearLayout02"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_gravity="bottom"
    android:background="#AA000000" >

    <Button
        android:id="@+id/btnsave"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:onClick="addCustomerDetails"
        android:text="Save"
        android:textColor="#000000" 
       >
    </Button>

    <Button
        android:id="@+id/btncancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Cancel"
        android:textColor="#000000" 
        android:onClick="canceladdcustomer">
    </Button>
</LinearLayout>

</FrameLayout>

Please correct me or provide any useful links, so that I will come to know my mistake.

Thanks for your valuable help!!

添加标签android:visibility =“ visible”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM