Android代码code设置9.png/9-patch 图片背景后,此view中的控件显示不正常

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.avatarswitch_dailog);

WindowManager.LayoutParams winLayoutParams =getWindow().getAttributes();

winLayoutParams.gravity = Gravity.LEFT|Gravity.BOTTOM;

winLayoutParams.dimAmount = 0.0f; // 去背景遮盖

getWindow().setAttributes(winLayoutParams);

Session.current.PushActivity(this);

dialoglayout=(TTACRelativeLayout)findViewById(R.id.avatardialoglayout);

avaScrollView=(TTACHorizontalScrollView)findViewById(R.id.avatar_hscroll_layout);

avatarItemsLayout=((TTACLinearLayout)findViewById(R.id.avatar_items_layout));

int avaBtnLeft = Integer.valueOf(getIntent().getStringExtra("avaBtnLeft"));

int avaBtnHeight = Integer.valueOf(getIntent().getStringExtra("avaBtnHeight"));


multiTabletsScreenStyleInfo=(TSMultiTabletsScreenStyleInfo)ResourcesPool.getInstance().getTsScreenStyleInfo(TSControlTypeDef.MultiTabletsScreenStyle);

//multiTabletsScreenStyleInfo.BalloonBackgroundColor

if (multiTabletsScreenStyleInfo.BalloonBackgroundColor>0 && BalloonBackgroundColorDef.BalloonColor.length>=multiTabletsScreenStyleInfo.BalloonBackgroundColor) {

dialoglayout.setBackgroundResource(BalloonBackgroundColorDef.BalloonColor[multiTabletsScreenStyleInfo.BalloonBackgroundColor-1]);

dialoglayout.setPadding(20, 20, 20, 20);//因为9-patch有自己的padding,所以View自己的padding被覆盖了,需要重新设置

}else {

dialoglayout.setBackgroundResource(R.drawable.balloon0);

dialoglayout.setPadding(20, 18, 20, 22);

}

FrameLayout.LayoutParams layoutParams = (LayoutParams)dialoglayout.getLayoutParams();

double[] screenRatio = Session.current.getNavigator()

.getCurrentScreen().getXYRatio();

if (screenRatio.length == 2) {

layoutParams.leftMargin=(int)(avaBtnLeft*screenRatio[0]);

layoutParams.bottomMargin=avaBtnHeight;

layoutParams.width=LayoutParams.WRAP_CONTENT;

layoutParams.height=LayoutParams.WRAP_CONTENT;

}

//set the avatar switch list

getAvatarSwitchList();

dialoglayout.setOnTouchListener(new OnTouchListener() {

@Override

public boolean onTouch(View arg0, MotionEvent arg1) {

// TODO Auto-generated method stub

return true;

}

});

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ESP32C3, esp-idf 4.3.5,编译报错。FAILED: wifi_softAP.elf cmd.exe /C "cd . && D:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-g++.exe -march=rv32imc -nostartfiles -march=rv32imc --specs=nosys.specs @CMakeFiles\wifi_softAP.elf.rsp -o wifi_softAP.elf && cd ." d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(softap_example_main.c.obj): in function `ch623_task': d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:164: undefined reference to `CH623_Init' d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:166: undefined reference to `pcd_lpcd_start' d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:168: undefined reference to `pcd_lpcd_application' d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:171: undefined reference to `pcd_lpcd_start' collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed. ninja failed with exit code 1
最新发布
05-31

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值