-4
A
回答
0
搖籃:
compile 'de.hdodenhof:circleimageview:2.1.0'
XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="60dp"
android:background="#808080">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="22dp"
android:text="TEST TEXT"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textStyle="bold"/>
</RelativeLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/iv_test"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:src="@drawable/placeholder" />
</RelativeLayout>
0
看看我的解決方案,我有自定義對話框使用
-
Dialog mDlg = new Dialog(SplashActivity.this);
mDlg.requestWindowFeature(Window.FEATURE_NO_TITLE);
mDlg.setContentView(R.layout.layout_head_dialog);
mDlg.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
mDlg.show();
XML設計
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorTransparent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@color/colorTransparent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="24dp"
android:background="@color/colorBlackFaint"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:padding="24dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Custom Dialog"
android:textColor="@color/colorWhite"
android:textSize="16sp"/>
</LinearLayout>
<ImageView
android:id="@+id/topImg"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/circle_view"
android:scaleType="fitXY"
android:src="@drawable/ic_check_offf"/>
</RelativeLayout>
</RelativeLayout>
輸出像這樣
相關問題
- 1. 設計佈局像下面的圖像按鈕圖像中的Android
- 2. 如何在Android xml中爲圖像設計紋理
- 3. Android的形狀XML像下面的圖像
- 4. android 2.1 xml drawables中的錯誤?在下面的圖像
- 5. 如何顯示程式設計TextView的像下面的圖片
- 6. Android:如何設計啓動畫面的圖像?
- 7. 在Android中,我如何設計一個像附加圖像的視圖?
- 8. 如何在XmL中創建像這樣的圓柱形設計圖案android
- 9. Android屏幕設計圖像
- 10. 如何在android中使用下面的圖像繪製線條
- 11. 如何在Android ImageView中設置圖像
- 12. 如何在Android中設置圖像
- 13. 如何在html和css中使用像下面的圖像div
- 14. android:如何使用計數器在imageview中設置圖像?
- 15. 在android中下載圖像
- 16. 如何設置android中的圖像
- 17. 如何在圖像視圖中更改svg圖像的xml源
- 18. 面向對象的圖像ImageList設計
- 19. 圖像下載的建築設計
- 20. 如何通過Android中的XML解析在圖庫上設置圖像?
- 21. 用於圖像設計的Android工具
- 22. Silverlight 4:datatemplate中的圖像未出現在設計圖面
- 23. 在設計模式下爲圖像使用固定大小android
- 24. 在下載圖像之前在webview中設置圖像的背景顏色android
- 25. 如何從XML頁面解析圖像
- 26. 如何從XML文件下載圖像?
- 27. 如何使文本留在圖像下(響應式設計)
- 28. 在Android中如何將圖像設置爲不同活動的圖像視圖?
- 29. 如何在Android的圖像視圖或按鈕中設置和存儲圖像?
- 30. 如何在肖像模式下設置捕獲的圖像
使用的FrameLayout – BlackHatSamurai
歡迎StackOverflow上。請學習問好問題 stackoverflow.com/help/how-to-ask –
這是用於定製對話框的xml設計嗎? – Sach