一、程序運行效果
二、代碼
1. ex04.java
public class ex02 extends Activity { private final int WC = LinearLayout.LayoutParams.WRAP_CONTENT; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); ImageButton btnOk = new ImageButton(this); Drawable dwOk = this.getResources().getDrawable(R.drawable.ex03_button_ok); btnOk.setImageDrawable(dwOk); LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(WC, WC); layout.addView(btnOk, param); ImageButton btnExit = new ImageButton(this); Drawable dwExit = this.getResources().getDrawable(R.drawable.ex03_button_exit); btnExit.setImageDrawable(dwExit); layout.addView(btnExit, param); LinearLayout out_layout = new LinearLayout(this); out_layout.setOrientation(LinearLayout.HORIZONTAL); out_layout.addView(layout, param); Button btn3 = new Button(this); btn3.setText("Button3"); btn3.setTextColor(Color.RED); LinearLayout.LayoutParams param2 = new LinearLayout.LayoutParams(WC, WC); param2.topMargin = 30; out_layout.addView(btn3, param2); setContentView(out_layout); btnOk.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setTitle("this OK button"); } }); btnExit.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { finish(); } }); } }
--完--
前提 你必須會創建aspire項目,不會的請先看微服務新體驗之Aspire初體驗 Aspirate (Aspir8) Aspirate 是將aspire項目發佈到k8s集羣的工具 安裝aspirate dotnet tool install
安裝配置相關軟件 安裝 PowerShell 7 / Core dotnet tool install --global PowerShell 安裝 Visual Studio 擴展 Microsoft Child Process Deb
前言 今天給大家分享一個.NET開源(MIT License)、免費、跨平臺(適用於 Windows、MacOS 和 Linux )、使用簡單的面部識別庫:FaceRecognitionDotNet。 項目介紹 FaceRecogniti
本週刊由 Python貓 出品,精心篩選國內外的 250+ 信息源,爲你挑選最值得分享的文章、教程、開源項目、軟件工具、播客和視頻、熱門話題等內容。願景:幫助所有讀者精進 Python 技術,並增長職業和副業的收入。 本期週刊分享了 12
官方安裝指南 https://developer.hashicorp.com/terraform/install https://developer.hashicorp.com/terraform/intro/getting-sta
LQR 是一種優化控制方法,設計目標是找到一組控制輸入,使得線性系統的狀態軌跡儘可能地接近目標,同時使控制輸入儘可能小。其目標函數是一個二次型成本函數。 分爲以下幾個步驟: 1. 設系統動態方程爲: 其中x爲狀態量,u爲控制輸入,A和B爲
Most commonly used tags in HTML Last Updated : 08 Mar, 2024 Most commonly used tags in HTML refer to HTM
https://www.w3schools.com/css/css_math_functions.asp The CSS math functions allow mathematical expressions to be used
CSS tutorials (w3school) https://www.schoolsw3.com/css/index.php (Русский язык) https://www.w3schools.com/css/css_intro
https://www.w3schools.com/css/css_important.asp What is !important? The !important rule in CSS is used to add more imp
https://www.w3schools.com/css/css_website_layout.asp Website Layout A website is often divided into headers, menus, co
https://www.w3schools.com/css/css_form.asp The look of an HTML form can be greatly improved with CSS: <!DOCTYPE html>
https://www.w3schools.com/css/css_counters.asp CSS counters are "variables" maintained by CSS whose values can be inc
https://zhuanlan.zhihu.com/p/670589063 CSS Specificity(CSS 特異性)是一個用來決定當多個CSS規則應用於同一個元素時,哪個規則將優先應用的機制。 What is Specific
https://www.w3schools.com/css/css_units.asp CSS Units CSS has several different units for expressing a length. Many CS