티스토리 뷰
<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&Hurdles
- 전압
- DYOV
- 전압전류모니터링
- Innovation&Hurdles
- Innovations
- Hurdles
- 배프
- 심심풀이
- 둎
- 절연형
- bilient
- BSC
- ServantClock
- 치매
- image
- 치매방지
- 혁신
- 심심풀이치매방지기
- badp
- 티스토리챌린지
- 오블완
- arduino
- Video
- 허들
- Decorator
- 전류
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 | 31 |
글 보관함