我正在尝试添加列表会话标题并在后面添加隐藏按钮。
请帮助我将 Del Button 和 Edit Button 发送到会话标题的后面。滑动后即可查看。
我还尝试了用力起作用的按钮上的bringToFront 和sendToBack。
要设置 Z 顺序,我需要将 Project min SDK 设置为 21,我不想这样做。所以我也不能使用 Z 顺序。
RelativeLayout SupRelLyoVar = new RelativeLayout(KxtVar);
RelativeLayout.LayoutParams NamLysHtrRloRulVaj = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, LyHtrHytVal);
SupRelLyoVar.setLayoutParams(NamLysHtrRloRulVaj);
Button DelBtnVav = new Button(KxtVar);
DelBtnVav.setId(View.generateViewId());
RelativeLayout.LayoutParams DelBtnRulVaj = new RelativeLayout.LayoutParams(LyHtrHytVal, LyHtrHytVal);
DelBtnRulVaj.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
DelBtnVav.setLayoutParams(DelBtnRulVaj);
SupRelLyoVar.addView(DelBtnVav);
Button EdtBtnVav = new Button(KxtVar);
RelativeLayout.LayoutParams EdtBtnRulVaj = new RelativeLayout.LayoutParams(LyHtrHytVal, LyHtrHytVal);
EdtBtnRulVaj.addRule(RelativeLayout.LEFT_OF, DelBtnVav.getId());
EdtBtnVav.setLayoutParams(EdtBtnRulVaj);
SupRelLyoVar.addView(EdtBtnVav);
LinearLayout LnrLyoVar = new LinearLayout(KxtVar);
LnrLyoVar.setBackgroundColor(SsnHtrBgdClr);
RelativeLayout.LayoutParams LnrLyoRulVaj = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, LyHtrHytVal);
LnrLyoRulVaj.addRule(RelativeLayout.CENTER_IN_PARENT);
TextView TxtVyuVav = new TextView(KxtVar);
LinearLayout.LayoutParams LysHtrTxtVyuRulVaj = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
TxtVyuVav.setLayoutParams(LysHtrTxtVyuRulVaj);
LnrLyoVar.addView(TxtVyuVav);
SupRelLyoVar.addView(LnrLyoVar, LnrLyoRulVaj);