当前位置:网站首页>Layout use case
Layout use case
2022-06-24 01:57:00 【╱℡&▓】
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActionBar.LayoutParams;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;
// Completely through code , To implement the interface
public class LayoutOne extends Activity {
private LinearLayout nameContainer = null;
private LinearLayout addressContainer = null;
private LinearLayout parentContainer = null;
// Rewriting methods
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
createNameContainer();
createAddressContainer();
createParentContainer();
setContentView(parentContainer);
}
// establish nameContainer
@SuppressLint("NewApi")
private void createNameContainer() {
nameContainer = new LinearLayout(this);
// layout With layout function , For example, set horizontal row 、 Vertical row , Can contain View, It can also include taking his place layout, So it is also a container
// stay Android I am learning , We use fill_parent, Include xml Use in fill_parent, stay API Level 8(Android
// 2.2) after , Change it to match_parent
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
nameContainer.setLayoutParams(layoutParams);
nameContainer.setOrientation(LinearLayout.HORIZONTAL);
// Set up the interior View
TextView txtView = new TextView(this);
txtView.setText(" full name :");
TextView valueView = new TextView(this);
valueView.setText(" Zhang San ");
nameContainer.addView(txtView);
nameContainer.addView(valueView);
}
// establish addressContainer
@SuppressLint("NewApi")
private void createAddressContainer() {
addressContainer = new LinearLayout(this);
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
addressContainer.setLayoutParams(layoutParams);
addressContainer.setOrientation(LinearLayout.VERTICAL);
TextView nameTextView = new TextView(this);
nameTextView.setText(" Detailed address :");
TextView valueTextView = new TextView(this);
valueTextView.setText(" Chemical fiber long way --- Dingjiazhuang ");
addressContainer.addView(nameTextView);
addressContainer.addView(valueTextView);
}
// establish rootView, And the first two container be similar , Different things addView It's not about joining the common view, But join layout
@SuppressLint("NewApi")
private void createParentContainer() {
parentContainer = new LinearLayout(this);
LayoutParams lParams = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
parentContainer.setLayoutParams(lParams);
parentContainer.setOrientation(LinearLayout.VERTICAL);
parentContainer.addView(nameContainer);
parentContainer.addView(addressContainer);
}
}边栏推荐
- Behind the 1.6 trillion requests per day, the secret of DNSPod - state secret DOH
- A review of Nature Neuroscience: dynamic representation in networked nervous system
- Global and Chinese dealox industry development status and demand trend forecast report 2022-2028
- 4、 Variable assignment method
- Typescript is a weak type
- Embedded hardware development tutorial -- Xilinx vivado HLS case (3)
- Echo framework: implementing service end flow limiting Middleware
- Analysis report on market development trends and innovation strategies of China's iron and steel industry 2022-2028
- Query report of each mic quality inspection result on SAP QM inspection lot?
- layer 3 switch
猜你喜欢

layer 3 switch
![[SQL injection 12] user agent injection foundation and Practice (based on burpsuite tool and sqli labs LESS18 target machine platform)](/img/c8/f6c2a62b8ab8fa88bd2b3d8f35f592.jpg)
[SQL injection 12] user agent injection foundation and Practice (based on burpsuite tool and sqli labs LESS18 target machine platform)

It's too difficult for me. Ali has had 7 rounds of interviews (5 years of experience and won the offer of P7 post)

I, a 27 year old female programmer, feel that life is meaningless, not counting the accumulation fund deposit of 430000

Stm32g474 infrared receiving based on irtim peripherals

Review of AI hotspots this week: the Gan compression method consumes less than 1/9 of the computing power, and the open source generator turns your photos into hand drawn photos

BIM model example
![[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)](/img/b5/a8c4bbaf868dd20b7dc9449d2a4378.jpg)
[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)
随机推荐
Ppt layout design how to make pages not messy
5、 Build freestyle projects and related knowledge
layer 3 switch
What is the difference between code signing certificates? What is the use of code signing certificates?
Behind the 1.6 trillion requests per day, the secret of DNSPod - state secret DOH
How to use the speech synthesis tool? Does the speech synthesis tool cost money?
SAP mm maintains inter company sto error -no delivery type defined for supplying
What is the reason why the switching page group disappears after easycvr establishes a multi-level group?
MySQL architecture
Nature Reviews Neuroscience: cognitive and behavioral flexibility - neural mechanisms and clinical considerations
What is "data" in data analysis- Cassie Kozyrkov
Tcapulusdb Jun · industry news collection (November 22)
Summary of various situations in which easycvr cannot use voice intercom function
Railway patrol system - Railway Intelligent Patrol communication system
Blog platform was falsely blackmailed and the new hacker organization claimed responsibility for the Israeli attack | November 16 global network security hotspot
What is the relationship between cloud desktop and cloud server? How to understand the relationship between the two
Tcapulusdb Jun · industry news collection
Go language core 36 lectures (go language practice and application VI) -- learning notes
Embedded hardware development tutorial -- Xilinx vivado HLS case (3)
Grpc: implement grpc proxy