object(mysqli_result)#13 (5) {
["current_field"]=>
int(0)
["field_count"]=>
int(25)
["lengths"]=>
NULL
["num_rows"]=>
int(1)
["type"]=>
int(0)
}
如何畫沒有背景的圓 How to draw a shape circle - 程序員論壇 - Powered by Discuz!
程序員論壇
標題: 如何畫沒有背景的圓 How to draw a shape circle [打印本頁]
作者: GreenCup 時間: 2021-4-8 10:35
標題: 如何畫沒有背景的圓 How to draw a shape circle
如何畫沒有背景的圓
How to draw a shape circle
circle.xml- <?xml version="1.0" encoding="utf-8"?>
- <shape
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval">
- <solid
- android:color="#eeeeee"/>
- <size
- android:width="120dp"
- android:height="120dp"/>
- </shape>
複製代碼 xxx.java- Drawable shape = ResourcesCompat.getDrawable(_context.getResources(), R.drawable.circle, _context.getTheme());
- TextView tv = new TextView(_context);
- tv.setBackground(shape);
- Broad_frame = new LinearLayout(_context);
- lparams_summary = new LinearLayout.LayoutParams(ballSize, ballSize);
- lparams_summary.setMargins(0, 0, 0, 0);
- Broad_frame.setLayoutParams(lparams_summary);
- Broad_frame.setPadding(0, 0, 0, 0);
- Broad_frame.setOrientation(LinearLayout.HORIZONTAL);
- Broad_frame.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
- Broad_frame.setBackgroundColor(Color.TRANSPARENT);
- Broad_frame.addView(tv);
複製代碼
歡迎光臨 程序員論壇 (http://program.thesmartfire.com/) |
Powered by Discuz! X2.5 |