画像の上に表示するために、HorizontalPanel内に2つのボタンを表示しようとしています。上ではなく、ボタンが表示され、さらにページを下に見て画像が表示されますが、画像を見ると、その上にボタンがあります。
これは、Page.ui.xmlファイルにこれまでにあるコードです。
<g:FocusPanel ui:field="profileImagePanel" addStyleNames="{style.headerImage}">
<g:AbsolutePanel addStyleNames="{style.innerImagePanel}">
<g:Image ui:field="profileImage" addStyleNames="{style.profileImage}"/>
<g:HorizontalPanel ui:field="imageEditButtons" addStyleNames="{style.imageEditButtons}">
<w:MultiUseButton ui:field="clearImage" addStyleNames="{style.change}" type="secondary" text="{i18n.clearImage}" visible="false"/>
<w:MultiUseButton ui:field="changeImage" type="secondary" text="{i18n.changeImage}" visible="false"/>
</g:HorizontalPanel>
</g:AbsolutePanel>
</g:FocusPanel>
スタイルは次のとおりです。
.headerImage {
position: absolute;
top: 0;
left: 0;
width: 150px;
}
.profileImage {
width: 150px;
position: relative;
}
.change {
float: right;
}
.headerImage a {
display: block;
}
.imageEditButtons {
width:100%;
}
.innerImagePanel {
width:150px;
}
AbsolutePanelの代わりにFlowPanelを使用してみましたが、機能しません。profileImageposition:relative
とimageEditButtonsを作成しようとしましposition:absolute
たが、ページの残りの部分の表示全体が台無しになります。imageEditButtonsも設定してみましmargin-top:-20px
たが、画像の上ではなく下に表示されます。画像の前のAbsolutePanelにHorizontalPanelを配置すると、ボタンが画像の上に表示され、上マージンを変更しようとすると、ボタンと画像が下に移動します。
アイデアが足りなくなっています。この作業を行う方法の提案をいただければ幸いです。