1
아래 코드를 사용하여 목록 항목의 이미지, 제목 및 텍스트 영역의 서식을 지정하는 레이아웃을 만들었습니다.
트위터 응용 프로그램 레이아웃처럼 보이게하려고합니다. 트윗을 어떻게 감쌀 것인지, 어떤 점이 누락 되었습니까?줄임표 표시 대신 줄 바꿈 할 목록 항목 행 가져 오기
플랫폼 세부 정보 : BB OS 5.0
코드 :
protected void sublayout(int width, int height) {
try {
deleteAll();
} catch (Exception ex) {
}
MyTitleField lblTitle = new MyTitleField(info.title);//extends LabelField
LabelField lblDesc = new LabelField(info.description , LabelField.ELLIPSIS)
{
protected void layout(int width, int height) {
// TODO Auto-generated method stub
super.layout(width, height);
}
};
BitmapField bmfIcon = new BitmapField(info.icon);
add(lblTitle);
add(lblDesc);
add(bmfIcon);
int iconHeight = bmfIcon.getBitmapHeight();
int fontHeight = Font.getDefault().getHeight();
int preferredWidth = width;//getPreferredWidth();
int startY = (rowHeight - iconHeight)/2;
layoutChild(bmfIcon, bmfIcon.getBitmapWidth(), bmfIcon.getBitmapHeight());
setPositionChild(bmfIcon, 5, startY);
int textWidth = preferredWidth - (bmfIcon.getBitmapWidth() +10);
int textStartX = bmfIcon.getBitmapWidth() + 10;
layoutChild(lblTitle, textWidth ,
fontHeight + 1);
setPositionChild(lblTitle, textStartX, startY);
int descHeight = rowHeight - (startY+fontHeight+2);
layoutChild(lblDesc, textWidth , descHeight);
setPositionChild(lblDesc, textStartX, (startY+fontHeight+2));
setExtent(preferredWidth, getPreferredHeight());
}
여기 줄임표 스타일을 제거 할 수없는 생산)' – icchanobot
그래, 할 수있어.하지만 그냥 끝까지 달려서 포장하지 않는다. – Irwin
blakberry-os5 개발을 위해 다운로드해야하는 JDE 버전을 알려 주실 수 있습니까? 나는 인터넷 검색으로 그것을 찾을 수 없다. – Viswa