티스토리 뷰
<MainActivity.kt>
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
val TL1 = findViewById(R.id.myTableLayout) as TableLayout;
val TR1 = TableRow(this);
val B1 = Button(this);
B1.setText("Dynamic Button");
TR1.addView(B1);
TL1.addView(TR1);
}
}
<activity_main.xml>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TableLayout
android:id = "@+id/myTableLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TableLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
반응형
'SWDesk > App' 카테고리의 다른 글
Kotlin + RecyclerView 테스트 예제 (2) | 2019.12.17 |
---|---|
[BPM] BPM User Tool, Ver.1.0 (0) | 2019.12.14 |
Kotlin + Dialog (0) | 2019.12.11 |
Dynamic Table Creation Test02 (0) | 2019.12.11 |
Dynamic Table Creation Test02 - Wrong Code (0) | 2019.12.09 |
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 전압전류모니터링
- Innovations
- 혁신과허들
- arduino
- 아두이노
- 오블완
- 전압
- 심심풀이
- 전류
- 심심풀이치매방지기
- Innovation&Hurdles
- 배프
- ServantClock
- DYOV
- 절연형
- 치매
- 둎
- 치매방지
- 빌리언트
- Video
- BSC
- Decorator
- Hurdles
- 혁신
- 허들
- bilient
- Innovations&Hurdles
- 티스토리챌린지
- image
- badp
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함