Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create popup layout

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 335
    Comment on it

    In the below example I have created popup layout. In popup.activity layout, First I have created LinearLayout, In LinearLayout I added a TextViw and Button, then in step second I have created rounded.xml layout & in drawable folder, here I have also added dialog shape and color properties. You can see below program it will clearly describe you to create  how to create popup layout window in android

    1. Step(1)-popup_activity.xml layout-
    2.  
    3. <?xml version="1.0" encoding="utf-8"?>
    4. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    5. android:orientation="vertical"
    6. android:layout_width="250dp"
    7. android:layout_margin="@dimen/margin_medium"
    8. android:background="@drawable/rounded_border"
    9. android:padding="@dimen/padding_small"
    10. android:layout_gravity="center"
    11. android:layout_height="110dp">
    12. <TextView
    13. android:layout_width="match_parent"
    14. android:layout_height="wrap_content"
    15. android:padding="@dimen/padding_small"
    16. android:gravity="center"
    17. android:textColor="@color/colorSpecialOffer"
    18. android:textSize="@dimen/text_medium"
    19. android:text="@string/maxSelectCat"/>
    20. <Button
    21. android:layout_width="80dp"
    22. android:layout_gravity="center"
    23. android:text="@string/ok"
    24. android:id="@+id/okButton"
    25. android:layout_marginTop="@dimen/margin_medium"
    26. android:textColor="@color/colorSpecialOffer"
    27. android:textSize="@dimen/text_large"
    28. android:background="@drawable/rounded_border"
    29. android:layout_height="30dp" />
    30.  
    31. </LinearLayout>
    32.  
    33. </RelativeLayout>
    34.  
    35. Step(2)-Create a rounded.xml layout in drawable folder
    36.  
    37. <?xml version="1.0" encoding="utf-8"?>
    38. <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    39. <item>
    40. <shape android:shape="rectangle" >
    41. <solid android:color="@color/font_color" />
    42. <corners android:radius="12dip" />
    43. <stroke
    44. android:width="1dip"
    45. android:color="@color/colorPrimaryDark" />
    46. </shape>
    47. </item>
    48. </layer-list>

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: