当前位置:网站首页>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);
}
}边栏推荐
- LeetCode 120. Triangle minimum path sum
- Typescript is a weak type
- 5、 Array base
- Summary of various situations in which easycvr cannot use voice intercom function
- 8、 Pipeline pipeline construction project
- [tcapulusdb knowledge base] how to rebuild tables in tcapulusdb table management?
- How to use the speech synthesis assistant? Does speech synthesis cost money?
- SAP mm Migo 411k error - correct the customizing settings for the unique
- [actual combat] how to realize people nearby through PostGIS
- How does the education industry realize the TRTC interactive classroom apaas solution under the "double reduction policy"?
猜你喜欢
![[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)

layer 3 switch

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

I, a 27 year old female programmer, feel that life is meaningless, not counting the accumulation fund deposit of 430000
![[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)

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

BIM model example
随机推荐
Build and enable all plug-ins of kubesphere high availability cluster
[read together] Web penetration attack and defense practice (I)
[planting grass by technology] three big gifts prepared by Tencent cloud for you on the double 11, welcome to touch~
Tcapulusdb Jun · industry news collection
Detailed explanation of SSH tunnel and stable intranet penetration using autossh
My eight year relationship with the message queue
Easycvr's use of Huawei IVS query directory shared information list interface
Thorough and thorough analysis of factory method mode
Tencent music, slow down?
Devops learning notes (II)
Learn 30 programming languages in 1 minute
Oracle sqlldr quick import and sqluldr2 quick export
Tcapulusdb Jun · industry news collection (November 22)
Blog platform was falsely blackmailed and the new hacker organization claimed responsibility for the Israeli attack | November 16 global network security hotspot
[tcapulusdb knowledge base] how to clean up tables in tcapulusdb table management?
BIM model example
Wechat open platform: OpenAPI, cloud development and basic management capability upgrade
Modify the original place where the method needs to be called and triggered
2021-11-10:o (1) time inserts, deletes and obtains random elements. Implement ra
How does SAP retail view which Po the allocation table is created with reference to?