성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
[정성태] 저렇게 조각 코드 말고, 실제로 재현이 되는 예제 프로젝트를 압...
[정성태] Modules 창(Ctrl+Shift+U)을 띄워서, 해당 Op...
[정성태] 만드실 수 있습니다. 단지, Unity 엔진 내의 스크립트와 W...
[공진영] 안녕하세요 좋은글 감사합니다. 현재 제가 wpf로 관제 모...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>Android - LinearLayout 간략 설명</h1> <p> 안드로이드를 거의 사용하지 않아서 간략 기록을 남깁니다.<br /> <br /> 가령, 50:50으로 컨트롤 2개가 화면을 분할하고 싶은 경우 다음과 같은 식으로 처리할 수 있습니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > <?xml version="1.0" encoding="utf-8"?> <LinearLayout 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" android:orientation="horizontal" <span style='color: blue; font-weight: bold'>android:weightSum="2"</span> > <Button android:text="Test1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/test1" <span style='color: blue; font-weight: bold'>android:layout_weight="1"</span> /> <Button android:text="Test2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/test2" <span style='color: blue; font-weight: bold'>android:layout_weight="1"</span> /> </LinearLayout> </pre> <br /> 참고로 이때 다음과 같이 layout 수치를 지정하면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > android:layout_height="100" </pre> <br /> 오류가 발생합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Android - error: Error: Integer types not allowed (at 'layout_height' with value '100') </pre> <br /> 이에 대해서는 다음의 글에서 설명하듯이,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > error: Error: Integer types not allowed (at 'layout_height' with value '10') ; <a target='tab' href='https://stackoverflow.com/questions/27819194/error-error-integer-types-not-allowed-at-layout-height-with-value-10'>https://stackoverflow.com/questions/27819194/error-error-integer-types-not-allowed-at-layout-height-with-value-10</a> </pre> <br /> 단위를 적용해 주면 된다고 합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > android:layout_height="100dp" </pre> <br /> 근데... 단위가 너무 많군요. ^^; <a target='tab' href='https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp'>px, in, mm, pt, dp or dip, sp</a>라고.<br /> <br /> <hr style='width: 50%' /><br /> <br /> 참고로, layout_weight가 꼭 비율을 의미하지는 않는 것 같습니다. 일례로 다음과 같이 하면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > <?xml version="1.0" encoding="utf-8"?> <LinearLayout 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" <span style='color: blue; font-weight: bold'>android:weightSum="5"</span>> <Button android:text="PC On/OFF" android:layout_width="wrap_content" android:layout_height="100dp" android:id="@+id/btnTurnPCOnOff" <span style='color: blue; font-weight: bold'>android:layout_weight="4"</span> /> <Button android:text="Refresh" android:layout_width="wrap_content" android:layout_height="100dp" android:id="@+id/btnRefresh" <span style='color: blue; font-weight: bold'>android:layout_weight="1"</span> /> </LinearLayout> </pre> <br /> 4/5와 1/5 영역으로 나누어질 것을 기대하게 되는데 약간 좀 다르게 보이는군요. ^^<br /> <br /> <img alt='turn_on_the_device_3.png' src='/SysWebRes/bbs/turn_on_the_device_3.png' /><br /> <br /> 그나저나, 이것도 체계적으로 좀 보고 머릿속에서 정리를 해야 하는데 시간 상 그때그때 땜방만 하게 되니.<br /> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
5380
(왼쪽의 숫자를 입력해야 합니다.)