object(mysqli_result)#13 (5) { ["current_field"]=> int(0) ["field_count"]=> int(25) ["lengths"]=> NULL ["num_rows"]=> int(1) ["type"]=> int(0) } 以編程方式將邊框添加到LinearLayout - 程序員論壇 - Powered by Discuz!

程序員論壇

標題: 以編程方式將邊框添加到LinearLayout [打印本頁]

作者: fire002    時間: 2021-4-18 07:54
標題: 以編程方式將邊框添加到LinearLayout
以編程方式將邊框添加到LinearLayout
Programmatically add border to LinearLayout
  1. //use a GradientDrawable with only one color set, to make it a solid color
  2.     GradientDrawable border = new GradientDrawable();
  3.     border.setColor(0xFFFFFFFF); //white background
  4.     border.setStroke(1, 0xFF000000); //black border with full opacity
  5.     if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
  6.       TitleLayout.setBackgroundDrawable(border);
  7.     } else {
  8.       TitleLayout.setBackground(border);
  9.     }
複製代碼





歡迎光臨 程序員論壇 (http://program.thesmartfire.com/) Powered by Discuz! X2.5